Source

text / Data / Text / Encoding.hs

Author Commit Message Labels Comments Date
Bryan O'Sullivan
Oh noes! I was miscalculating the initial buffer size! When performance testing encodeUtf8, I noticed that for some reason I was still seeing "ensure" show up in the profile, when I expected it shouldn't have been. Turns out I was using a "min" where I should have been using a "max", and thus allocating an initial bytestring that would almost always be too small, thus forcing reallocations and copying. Boo!
Bryan O'Sullivan
Eliminate unnecessary resizes from encodeUtf8. We had been performing a resize any time that (a) we had data to write and (b) we got to within 4 bytes of filling the target bytestring. This was safe, but suboptimal, as it meant that in the common case of encoding ASCII text, we would *always* perform a resize. Now, we check the exact number of bytes we need to fit, and resize only if they won't fit. This eliminates resizes for ASCII data, an…
Bryan O'Sullivan
Improve error message.
Bryan O'Sullivan
Add decodeUtf8'.
Bryan O'Sullivan
Many small documentation improvements.
Bryan O'Sullivan
Get rid of the old decode function
Bryan O'Sullivan
Add a rewrite rule for fusion
Bryan O'Sullivan
Write a faster UTF-8 decoder
Bryan O'Sullivan
Remove old UTF-8 encoding functions
Bryan O'Sullivan
Update copyright
Bryan O'Sullivan
Rewrite encodeUtf8 for speed This was inspired by a patch from Simon Meier, who wrote a direct implementation of encodeUtf8 using his 'blaze-builder' package. His code showed a very impressive speedup. My code is similar in both structure and performance, its chief difference being that it doesn't require 'blaze-builder'.
Bryan O'Sullivan
Change Tom's email address
Bryan O'Sullivan
Add controllable error handling and recovery code.
Bryan O'Sullivan
Update copyrights and maintainers.
Tags
0.2
Bryan O'Sullivan
Fix Haddocks
Bryan O'Sullivan
Move Utf* modules into Data.Text.Encoding
Bryan O'Sullivan
Test the remaining supported encodings
Bryan O'Sullivan
Split encoding support out into new modules