I implemented a sequential version of the LCS algorithm in F#, and ran it against two strings of 100,000 characters each. It consistently took around 490 seconds to run to completion. I expected something closer to 70 seconds.
After a lot of troubleshooting, I tracked this down to my use of a custom max function - removing that reduced the run time to 42 seconds.
Can anyone tell me why using a custom max function has such a massive performance hit? In this instance it was 12x slower to use a custom max function over System.Math.Max Operators.max!
This is the function I was using:
let max (a:int) (b:int) : int = if a > b then a else b