As noted in the code, bitwise-{and|ior|xor} and functions that use them are really slow. Specifically, the pattern of splitting into high and low parts and recombining makes these operations take time quadratic in the length of their input.
I've written a benchmark that stresses bitwise ops. Currently Racket 6.8 outperforms Larceny on it by a factor of 10 (though, of course, that varies when the problem size changes).
Ideally, these functions would take linear time. I notice that Larceny provides integer-logand and friends (in bignums.sch). Is there any reason we can't just use those?
(This is related to #414, but only incidentally.)
As noted in the code,
bitwise-{and|ior|xor}
and functions that use them are really slow. Specifically, the pattern of splitting into high and low parts and recombining makes these operations take time quadratic in the length of their input.I've written a benchmark that stresses bitwise ops. Currently Racket 6.8 outperforms Larceny on it by a factor of 10 (though, of course, that varies when the problem size changes).
Ideally, these functions would take linear time. I notice that Larceny provides
integer-logand
and friends (in bignums.sch). Is there any reason we can't just use those?