[Haskell-cafe] Re: OCaml list sees abysmalLanguage Shootoutresults
MR K P SCHUPKE
k.schupke at imperial.ac.uk
Fri Oct 8 14:28:53 EDT 2004
>In general only specific *code* can be compiled more efficiently.
I disagree - If GHC optimised as much as is _possible_ the code would
be as fast and use as little memory as hand coded 'C'
>It can't be transparent. A different type for semi-packed strings,
Again I disagree... I dont see why you cannot change the "implementation"
of lists without changing the "interface"... Good old lists will
behave like good old lists - just the implementation would try
and take advantage of blocking of the data wherever possible.
Perhaps a pragma to change the implementation of lists would ne
be a sensible way of selecting the implementation. If a clever
way of encoding the node-size (for large cells) is used, then
it would be no slower than normal list code... One way of doing this
would be to only change the format of cells where the next link is
null (IE the end of the list)... In this case normal cells would
be encoded _exactly_ as they are at the moment (so no slowdown
or increase in memory usage) - to encode a large cell, the next
pointer is null, and then an extra data structure determines
if this really is the end of the list, or if infact it is a large
cell (so we need an item count, and a _real_ next cell link,
plus the data block)
More information about the Haskell-Cafe