>>20
They probably differ by a linear factor running very similarly to one another because you wrote the same algorithm twice. The linear factor whether from peep-hole optimizations or smaller run-time will be relevant when it is, and not otherwise. Chances are your application is not using optimal algorithms, or contains superfluous representation conversions, or solves a more expensive problem than necessary, etc. it'd be advantageous to focus on these first. After you resolve these high-level issues if linear factors are still relevant for your use case you can rewrite relevant portions in a low-level language like NASM (perhaps this can even be done inline as in GOOL of Crash Bandicoot fame).