winterland1989 / binary-parsers

Extends binary with parsec/attoparsec style parsing combinators
BSD 3-Clause "New" or "Revised" License
26 stars 8 forks source link

Benchmarks don't use attoparsec best practices #2

Open andrewthad opened 7 years ago

andrewthad commented 7 years ago

I noticed that in the benchmarks for http-req, the inClass function from attoparsec is used. However, the equivant binary-parsers code writes the predicate by hand. Attoparsec's documentation warns against using inClass in the [Performance Considerations] section. To make this benchmark reflect attoparsec's performance more accurately, I think that isHeaderChar should become a top level function that is called by both attoparsec code and by binary-parsers code.

winterland1989 commented 7 years ago

Ah, that code is copied from attoparsec and when write other benchmarks I just use comparison for simplicity, it is indeed an unfair bench, could you send me a patch with result?