I implemented a sequential version of the LCS algorithm in F # and ran it against two lines of 100,000 characters each. It lasted about 490 seconds to complete. I was expecting something closer to 70 seconds.
After a lot of troubleshooting, I tracked this down to using the custom max delete function, which reduced the execution time to 42 seconds.
Can someone tell me why using max user function has such massive success? In this case, it is 12 times slower to use the user-defined function max over System.Math.Max Operators.max!
This is the function I used:
let max (a:int) (b:int) : int = if a > b then a else b
source share