Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executeMany optimisations #17

Open
zenzike opened this issue Jan 1, 2012 · 1 comment
Open

executeMany optimisations #17

zenzike opened this issue Jan 1, 2012 · 1 comment

Comments

@zenzike
Copy link
Member

zenzike commented Jan 1, 2012

Currently, executeMany is simply a call to replicateM execute. This could be optimised.

@soenkehahn
Copy link
Contributor

I've done work on this in this branch:
https://github.com/soenkehahn/hdbc-postgresql/tree/binaryNumbers

The main changes are:

  1. SqlDoubles, SqlInt32s and SqlInt64s are given to postgres in binary form.
  2. Some arrays that are used for this are reused in executeMany, so it gets a little faster than mapM_ execute.
  3. There is a new benchmarking executable (buildable with -fbuildbenchmarks) that benchmarks mapM_ execute vs. executeMany.
  4. There are new quickcheck properties, mainly for testing readFromDB . writeToDB == id.
  5. Somewhat unrelated to executeMany: I switched to hexadecimal format for giving and retrieving bytestrings to and from postgres. This fixes one (at least perceived) bug that the quickcheck properties exposed: Now you can write and read any SqlByteString to postgres as a bytea without dealing with escaping or en-/decoding. Feedback on this is very welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants