On Mon, 16 Aug 2010 12:20:20 +0200, Tim Bunce <[email protected]>
wrote:
> On Wed, Aug 04, 2010 at 10:51:41PM +0200, H.Merijn Brand wrote:
> >
> > My intention was/is to have a DBI replacement for DB_File, so the
> > *only* thing I have to change to use it is
> >
> > tie my %hash, "DB_File", "file.db", O_RDWR|O_CREAT, 0666;
> >
> > with
> >
> > tie my %hash, "Tie::DBD", $dbh;
> >
> > And the rest of my code will still work. With the current
> > implementation of Tie::DBI I would have to rewrite everything.
>
> Also, from memory, Tie::DBI is painfully slow due in part to not using
> prepared statements.
I use prepare and bind_columns.
DBD::SQLite was almost as fast as DB_File :)
I still think my work could/should be integrated in Tie::DBI, but
Lincoln is still on holiday.
After that, the next step to also implement Tie::Array::DBD is a breeze.
Tie::Array::DBD would also well qualify to be used in IO::All, a sick
module from Ingy
Linux 2.6.31.12-0.2 Core(TM) i5 CPU 660 @ 3.33GHz/1199(2) x86_64 7802 Mb
v5.12.1
records/second
Size op DB_File SQLite Pg mysql CSV Oracle
------ -- ---------- ---------- ---------- ---------- ---------- ----------
20 rd 84033.6 8186.7 4592.4 3511.9 678.1 2060.6
20 wr 120481.9 12091.9 2835.3 3024.3 795.8 1159.3
200 rd 59701.5 29832.9 8242.7 1871.2 102.9 3407.8
200 wr 37871.6 27401.0 4995.8 2238.5 187.9 1631.4
2000 rd 46839.5 37449.7 8733.5 252.4 - 3536.0
2000 wr 35635.4 30101.4 5108.8 463.2 - 1678.3
20000 rd 55910.0 35692.4 8534.7 - - 3521.6
20000 wr 32173.6 28710.7 5025.5 - - 977.4
200000 rd 49998.5 32987.7 8274.2 - - 3550.6
200000 wr 29060.7 24028.1 4911.6 - - 881.1
--
H.Merijn Brand http://tux.nl Perl Monger http://amsterdam.pm.org/
using 5.00307 through 5.12 and porting perl5.13.x on HP-UX 10.20, 11.00,
11.11, 11.23, and 11.31, OpenSuSE 10.3, 11.0, and 11.1, AIX 5.2 and 5.3.
http://mirrors.develooper.com/hpux/ http://www.test-smoke.org/
http://qa.perl.org http://www.goldmark.org/jeff/stupid-disclaimers/