Is Haskell-Beam Deserialization slow? #767
Replies: 4 comments 1 reply
-
Hmm this is interesting, thanks for your benchmark! The beam PostgreSQL backend is based on Another potential idea: did you compile the Haskell executable using the maximum amount of optimization? I don't know if the base level of optimization in Rust is different. |
Beta Was this translation helpful? Give feedback.
-
I did try with |
Beta Was this translation helpful? Give feedback.
-
Thanks, this is already quite a large difference. |
Beta Was this translation helpful? Give feedback.
-
Even after |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm using Beam in Haskell to load around 14.5 million rows from a PostgreSQL table (for benchmarking purpose)
Posted this in Stackoverflow(but got rejected🥲): https://stackoverflow.com/questions/79687504/is-haskell-beam-deserialization-slow
Here’s the simplified version of my query:
Here's the Table
Total rows: 14,519,095
PostgreSQL query execution itself takes only ~4s
When I rewrote the same query using postgres-simple, the load time dropped to ~60s (which is still slow)
because the profiling told something like
Is the overhead coming from libpq(getValue') which beam and postgres-simple uses or the free monad that beam relies on?
How can I mitigate this problem?
Beta Was this translation helpful? Give feedback.
All reactions