How do we best make sure {Int,Word,Float,Double} to {Int,Word,Float,Double} conversions stay efficient

Simon Peyton-Jones simonpj at
Mon Dec 17 10:46:50 CET 2012

The sure-fire way is to make a loop that doesn't allocate if the rules fire; after all that's the ultimate goal.  Then you can put it in tests/perf/should_run.

doing -ddump-simpl and greping for stuff that should/should-not be there is another alternative we use in places.


| -----Original Message-----
| From: glasgow-haskell-users-bounces at [mailto:glasgow-haskell-
| users-bounces at] On Behalf Of Johan Tibell
| Sent: 14 December 2012 20:54
| To: glasgow-haskell-users
| Subject: How do we best make sure {Int,Word,Float,Double} to
| {Int,Word,Float,Double} conversions stay efficient
| Hi,
| I've been tracking down a few (unrelated) performance bugs related to
| conversions between primitive types. What these issues had in common is
| that some rule failed to fire and the conversion went via Integer,
| killing performance. How do we best write a test that make sure that
| fromIntegral conversions between these types don't regress? Is it
| possible to test the output of the simplifier or do we have to do
| something less direct, like writing a loop that does such conversions
| and make sure that the allocation stay low?
| -- Johan
| _______________________________________________
| Glasgow-haskell-users mailing list
| Glasgow-haskell-users at

More information about the Glasgow-haskell-users mailing list