Closed kvanbere closed 10 years ago
Thanks for the feedback, kvanberendonck. I think all those instances are in top-level constants which I'm not worried about. If they're being calculated more than once then I have much bigger problems! Closing for now, but please let me know if you find any other issues looking at the core or benchmarking.
Sure, just means whatever is using it will have an extra branch to see if it needs forcing since it won't be inlined+strictified. If it does get inlined into i.e. moveToNextCell
, you'd be in trouble.
I'll do a core inspection for you tonight. I think you closed this too promptly imo.
Yeah, you're right, thanks; re-opening so I remember to look into this later. I initially had plans to make sEGMENT_LENGTH
configurable, but I'm not sure that's necessary. I might just hard-code the values and assert
that they equal the calculated value or something.
After inspecting core, GHC does not inline the floating point operations in the constants. Still persue if you want the tiny speedup for the constants being strict, otherwise it's safe to close for now probably.
In the source there are some constants which have type
Float
wrapped inround
. GHC doesn't do any form ofFloat
constant folding yet, so you should hand-calculate these intoInt
(and probably leave the original ones commented out above) for a tiny speed bonus.