5 Jun 2002 ksandstr   » (Journeyer)

Thoughts on compilers and such

While prototyping miscellaneous stuff with O'Caml (it's quite a neat language for that [among other things], if you can mentally push aside the 31-bit signed integer thingy), I noticed that there are some rather common (in the semi-functional language world anyway) ways of further optimizing code that the ia32 compiler doesn't seem to know about. Closure inlining in a "map", "iter" or "init" construct and instantiation of certain functions where the function has been partially applied to a constant parameter that would cause significant strenght-reduction (or other) gains in the emitted code, just to name two. Then again, I haven't examined the output to see what the compiler does at different "-inline" levels, so there's no telling what I may be missing... I'm a bit surprised though that the compiler that gets second place for many weightings of the ``great computer language shootout'' scorecard doesn't implement the closure-loop inlining thing, seeing as function calls through a pointer are somewhat expensive when compared to function calls to a fixed address.

Maybe I'll take a look at the compiler's source later on, just for the hell of it.


Why do I always get most work done a couple of days before a deadline? And why is most of the work that I do right before said deadline of the "this bit was misdesigned in the first place, so I'll reimplement a better version of something equivalent in one fourth of the source lines" kind? Do I really suck that much? :-)

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!