Your code is slow because the arrays are not sorted by x and sorting is expensive for large arrays. Where does the data come from? What precision do you need? How do you measure speed? How often does this need to run?
What data are you interested in? (difference in Y? relative shift in x? etc.) Overall, you seem to have way too much data to describe the curve, so if you could somehow decimate it to a more reasonable size, if will speed up greatly. Adjacent points are currently highly correlated (redundant information!)and the same curves can be described with 5% of the points. Also, for the interpolation, you could use a linear x ramp in the range [0.1...1.2] with a few hundred points and interpolate both curves using it as x.