Skip to content

Instantly share code, notes, and snippets.

Created March 19, 2015 02:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/ac75855b071fa133cb9b to your computer and use it in GitHub Desktop.
Save anonymous/ac75855b071fa133cb9b to your computer and use it in GitHub Desktop.
$ perl -Mojo -MMojo::Pg -E 'my $pg = Mojo::Pg->new("postgresql://tester:testing@/test?pg_server_prepare=0")->max_statements(0); $pg->db->query("create table names (id serial primary key, name text)"); n { $pg->db->query("insert into names (name) values (?)", "Sebastian") } 10000; n { $pg->db->query("select name from names where id = ?", 5999)->hash } 10000; $pg->db->query("drop table names");'
3.74424 wallclock secs ( 0.93 usr + 0.31 sys = 1.24 CPU) @ 8064.52/s (n=10000)
2.34725 wallclock secs ( 1.06 usr + 0.31 sys = 1.37 CPU) @ 7299.27/s (n=10000)
$ perl -Mojo -MMojo::Pg -E 'my $pg = Mojo::Pg->new("postgresql://tester:testing@/test?pg_server_prepare=1")->max_statements(10); $pg->db->query("create table names (id serial primary key, name text)"); n { $pg->db->query("insert into names (name) values (?)", "Sebastian") } 10000; n { $pg->db->query("select name from names where id = ?", 5999)->hash } 10000; $pg->db->query("drop table names");'
3.35847 wallclock secs ( 0.79 usr + 0.29 sys = 1.08 CPU) @ 9259.26/s (n=10000)
1.77151 wallclock secs ( 0.91 usr + 0.28 sys = 1.19 CPU) @ 8403.36/s (n=10000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment