Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

executeMany optimisations #17

Open
zenzike opened this Issue · 1 comment

2 participants

@zenzike
Owner

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

@soenkehahn

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
Something went wrong with that request. Please try again.