paul-rouse / mysql-simple

A mid-level client library for the MySQL database, intended to be fast and easy to use.
Other
91 stars 35 forks source link

`parseTime` is 20x slower than an attoparsec parser #47

Open parsonsmatt opened 6 years ago

parsonsmatt commented 6 years ago

cf https://github.com/andrewthad/chronos/pull/18#issuecomment-399156964

Currently mysql-simple uses parseTime to parse the time. Using a custom attoparsec parser would make things faster and more memory efficient.

paul-rouse commented 6 years ago

Chronos is interesting! Do you think the overall gain would be significant, in the context of the whole processing of a result?

parsonsmatt commented 6 years ago

That's the important question :) I'll have to write a benchmark for it! Someone on FPChat mentioned that parsing UTCTime out of a database query was taking 20% of the runtime of his app, which got me on this chase.