PEPPLER.ORG
Michael Peppler
Sybase Consulting
Menu
Home
Sybase on Linux
Install Guide for Sybase on Linux
General Sybase Resources
General Perl Resources
Freeware
Sybperl
Sybase::Simple
DBD::Sybase
BCP Tool
Bug Tracker
Mailing List Archive
Downloads Directory
FAQs
Sybase on Linux FAQ
Sybperl FAQ
Personal
Michael Peppler's resume

sybperl-l Archive

Up    Prev    Next    

From: mpeppler at itf dot ch (Michael Peppler)
Subject: BCP module speed
Date: Feb 21 1996 11:07AM

To continue the discussion that was going on here last week regarding
the speed of sybperl's bcp API vs. Sybase's bcp program I ran some
tests:

I wrote a bcp program in C that does the same thing as the minimal
sybperl implementation, and ran that to get a base value. Then I ran
the sybperl version using the normal bcp_*() calls, then I ran the same
script using the BCP module. To make the timings fairer, I ran the
programs on a different machine from where the SQL server was running
(and the server was NOT quiescent during the tests).

The upload consists of 10000 rows of 12 fields each, sent in 200 row
batches, and there was no index or trigger on the target table, so
'fast' (non-logged) bcp was used.

The C version took ~24 seconds (8.5 seconds user time, 0.5 system).
The standard sybperl version took ~37 seconds (20.8 user, 0.5 system)
The Sybase::BCP version took ~43 seconds (22.2 user, 0.6 system).

The BCP version is a little bit slower because it 'remembers' all the
rows sent to bcp_sendrow() until the batch has been succesfully sent
(so that it can re-run the batch one by one to extract the invalid
rows). Still it is nice to see that although the perl versions are
quite a bit slower, it's a hair under 2x elapsed time, and less than 3x
cpu time.

Of course, if you have callbacks on all the fields, etc... the speed is
going to suffer somewhat (for example, adding a callback at the row
level - called once for each row - adds approx 1.5 seconds user cpu
time).

Michael