Skip to content
README.org 924 B
Newer Older
* COMMENT -*- mode: org -*-
#+Date: 2016-12-16
Time-stamp: <2016-12-17>

* database binding benchmark
I want to know the efficiency of the db binding for different language,
libraries and database servers.

- table:
  CREATE TABLE foo
  (id integer primary key,
   bar integer);
  INSERT INTO foo (id, bar) VALUES (1, 1);

- run many times:
  SELECT * FROM foo
  UPDATE foo SET bar=bar+1 WHERE id=1

* benchmark results
** postgres 9.4, cpython 2.7, psycopg2==2.6.1
http://initd.org/psycopg/docs/usage.html
0.35
28.77
--
0.38
26.15
--
0.37
26.35
** postgres 9.4, C, libpq5
https://www.postgresql.org/docs/9.4/static/libpq.html
0.33
26.6
--
0.32
26.5
--
0.30
26.2

//side note: why adding -shared in LDFLAGS will just segfault the program?
** postgres 9.4, lts-7.13, ghc 8.0.1, postgresql-simple
0.71
27.5
--
0.63
27.2
--
0.61
26.2
** postgres 9.4, lts-5.18, ghc 7.10.3, postgresql-simple
0.61
26.6
--
0.59
26.8
--
0.63
26.6