[gambit-list] Nearly 20% performance improvement with -fstrict-aliasing

Marc Feeley feeley at iro.umontreal.ca
Sun Oct 28 09:03:12 EDT 2012

Le 2012-10-25 à 4:19 PM, Bradley Lucier <lucier at math.purdue.edu> a écrit :

> The C memory aliasing model allows certain kinds of optimizations.  

I agree that it would be good to implement those changes to Gambit.  Not only would it improve performance, but the code would be more portable (there might be some C compilers without the equivalent of a -fno-strict-aliasing flag).

The problem is that this is a daunting task.  gambit.h is written in a style that assumes a simple memory model, so basically every line of gambit.h has to be examined to see whether a change is needed or not.  I'm fairly confident that few actual changes are needed (on the order of 100 lines of code is my guess).  Would you be interested in doing this with my assistance?  This can probably be done incrementally over a few weeks, say 500 lines of gambit.h a day.  In a first phase we could focus on those changes we know are absolutely needed (because they cause specific benchmark programs to malfunction).  I could add a configure option to enable strict-aliasing so that performance minded adventurous people (like you?) have the option to build Gambit with a strict-aliasing assumption.  When we are confident all cases are handled, we can flip the default of that option to "enabled".


More information about the Gambit-list mailing list