Skip to content

Instantly share code, notes, and snippets.

Created March 18, 2015 20:15
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/2acf4dcfff46593a2175 to your computer and use it in GitHub Desktop.
Save anonymous/2acf4dcfff46593a2175 to your computer and use it in GitHub Desktop.
$ perl -Mojo -MMojo::Pg -E 'my $pg = Mojo::Pg->new("postgresql://tester:testing@/test"); $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.64136 wallclock secs ( 0.83 usr + 0.30 sys = 1.13 CPU) @ 8849.56/s (n=10000)
2.11883 wallclock secs ( 0.91 usr + 0.29 sys = 1.20 CPU) @ 8333.33/s (n=10000)
$ perl -Ilib -Mojo -MMojo::Pg -E 'my $pg = Mojo::Pg->new("postgresql://tester:testing@/test"); $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.35646 wallclock secs ( 0.77 usr + 0.29 sys = 1.06 CPU) @ 9433.96/s (n=10000)
1.77296 wallclock secs ( 0.89 usr + 0.28 sys = 1.17 CPU) @ 8547.01/s (n=10000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment