haskell / attoparsec

A fast Haskell library for parsing ByteStrings
http://hackage.haskell.org/package/attoparsec
Other
514 stars 93 forks source link

Provide ShortByteString API #225

Open hasufell opened 7 months ago

hasufell commented 7 months ago

ShortByteString now has the same API as ByteString. It has certain benefits and is used in the new OsPath type.

hasufell commented 7 months ago

I guess most of the optimization tricks rely on the fact that we can walk and shift around buffers in ByteString and Text without copying any data (which is not true for ShortByteString).

So a ShortByteString API would likely just do fromShort and toShort at the outer layers? I could attempt a full ShortByteString implementation, but my guess is that it would be magnitudes slower due to more copying.

hasufell commented 3 months ago

After writing my blog The ultimate guide to Haskell Strings I think the most sensible strategy is to: