
Hello Don, Tuesday, September 23, 2008, 4:36:55 AM, you wrote:
it isn't the same as readInt which was added specifically for this test. it doesn't support arbitrary-size streams and doesn't return rest of stream
Hmm? That is wrong. These functions explicitly work on arbitrarily long lazy bytestrings, and return the rest of the stream in a pair:
lazy bytestring which is read from file on demand is the same as arbitrary-sized stream. equivalent C code would be much faster (and probably limited by memory speed)
readInt :: ByteString -> Maybe (Int, ByteString) readInteger :: ByteString -> Maybe (Integer, ByteString)
These are the initial parts of a bytestring lexing library, more of which is appareing in the bytestring-lex package on Hackage.
readInt was added to FPS library by you and immediately used to improve speed of this benchmark two years ago. there was no readInteger since shootout doesn't contain such benchmarks :) -- Best regards, Bulat mailto:Bulat.Ziganshin@gmail.com