ocaml-batteries-team/batteries-included — pull request #590 by cakeplus (2014-09-20 18:57:43+00:00)
Title: Int.Safe_int.mul performance improvement

A slight improvement to the recently added performance hack in the implementation of Int.Safe_int.mul: support for negative numbers and 32-bit platforms. It now fares much better in a particular real world application of mine.

What I don't like about those bit-twiddling performance hacks is how implementation-specific they usually are. For example, integers are untagged in js_of_ocaml, which doesn't break correctness in our particular case, yet shows that we're walking on thin ice when it comes to certain optimizations.