Skip to content
README.org 1.57 KiB
Newer Older
* COMMENT -*- mode: org -*-
#+Date: 2016-12-16
Yuanle Song's avatar
Yuanle Song committed
Time-stamp: <2017-01-25>

* 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
Yuanle Song's avatar
Yuanle Song committed
each entry has format: db_server, compiler, libraries
all build is release mode (with -O or equivalent).

** 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
Yuanle Song's avatar
Yuanle Song committed
** postgres 9.4, rust 1.13.0, postgres 0.13
0.48
26.3
--
0.53
26.2
--
0.50
28.0
Yuanle Song's avatar
Yuanle Song committed
** postgres 9.4, go 1.7.3, pq
0.385
27.0
--
0.367
27.6
--
0.423
30.7
--
0.362
27.2
--
0.372
26.4
Yuanle Song's avatar
Yuanle Song committed
** postgres 9.4, racket 6.5
2.21
26.72
--
1.85
26.63

- I think I maybe testing disk IO performance. should use the pg bench cluster
  for benchmarking. bench cluster listen on port 5433.

  when running against bench cluster.
  result is
  2.15
  2.29
  --
  2.10
  2.21

  So write performance is definitely testing disk IO performance. Read
  performance is related to the language and runtime.