Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
* COMMENT -*- mode: org -*-
#+Date: 2016-12-16
Time-stamp: <2016-12-16>
* 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?