winterkoninkje: Shadowcrane (Default)
[personal profile] winterkoninkje

bytestring-lexing 0.3.0

The bytestring-lexing package offers efficient reading and packing of common types like Double and Integral types.

Administrative Changes (since 0.2.1)

Change of maintainer. Don Stewart handed maintainership of the package over to myself when I voiced interest.

Change of repo type. The old repo for the package used Darcs-1 style patches. I've converted the repository to Darcs-2 hashed. This means that the new repository cannot exchange patches with the old Darcs-1 repo (or any other Darcs-2 conversions that may be floating around out there). So anyone who's interested in contributing should scrap their local copies and get the new repo.

Code Changes (since 0.2.1)

Added Data.ByteString.Lex.Integral which provides efficient implementations for reading and packing/showing integral types in ASCII-compatible formats including decimal, hexadecimal, and octal.

The readDecimal function in particular has been highly optimized. The new version is wicked fast and perfectly suitable for hot code locations like parsing headers for HTTP servers like Warp. In addition, attention has been paid to ensuring that parsing is efficient for larger than native types like Int64 on 32-bit systems (including 64-bit OS X), as well as Integer. The optimization of this function was done in collaboration with Erik de Castro Lopo, Vincent Hanquez, and Christoph Breitkopf following a blog post by Erik and ensuing discussion on Reddit.

A Criterion report is available for 64-bit Intel OS X running 32-bit GHC 6.12.1. The benchmark is included in the repo and has also been run on 64-bit GHC 7 systems, which differ primarily in not showing slowdown for Int64 vs Int (naturally). If you're curious about the different implementations:

  • readIntBS / readIntegerBS --- are the readInt and readInteger functions in Data.ByteString
  • readDecimalOrig (correct) --- was my original implementation, prior to collaboration with Erik, Vincent, and Christoph.
  • readIntegralMH (buggy) --- or rather a non-buggy version very much like it, is the implementation currently used in Warp.
  • readDecimal (current) --- is the current implementation used in this package.

Links

Profile

winterkoninkje: Shadowcrane (Default)
wren gayle romano

July 2014

S M T W T F S
   12345
678 910 11 12
1314151617 1819
20212223242526
2728293031  

Most Popular Tags

Expand Cut Tags

No cut tags

Style Credit

Page generated Jul. 26th, 2014 07:06 am
Powered by Dreamwidth Studios