[rt-devel] Optimisations to EasySearch/Record
Jesse
jesse at fsck.com
Wed May 17 17:55:11 EDT 2000
Loading sets of rows with my DBIx Abstraction layer (EasySearch and
Record) used to be O(n). As of about 5 minutes ago, it's O(1).
This results in a >20% perf improvement when loading large numbers of rows.
For example, here's the output of Devel::DProf when doing an rtq
against a queue with 1475 open tickets being displayed:
BEFORE:
Total Elapsed Time = 57.65688 Seconds
User+System Time = 17.58688 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c Name
10.8 1.899 1.879 5903 0.0003 0.0003 DBI::st::execute
10.0 1.763 18.593 1 1.7632 18.593 rt::ui::cli::query::ParseArgs
6.36 1.118 2.499 4426 0.0003 0.0006 DBIx::EasySearch::Limit
5.96 1.049 1.074 4426 0.0002 0.0002 DBIx::EasySearch::_GenericRestrict
ion
5.79 1.019 1.318 13275 0.0001 0.0001 RT::Record::_Value
5.45 0.959 1.413 4427 0.0002 0.0003 DBD::_::st::fetchrow_hashref
4.88 0.859 7.787 1476 0.0006 0.0053 DBIx::EasySearch::_DoSearch
4.43 0.779 1.387 5905 0.0001 0.0002 DBI::_new_handle
3.92 0.690 2.035 5903 0.0001 0.0003 DBI::_new_sth
3.46 0.609 5.561 4427 0.0001 0.0013 DBIx::Record::_LoadFromSQL
3.35 0.590 0.569 5905 0.0001 0.0001 DBI::_setup_handle
3.04 0.534 19.351 1 0.5338 19.350 rt::ui::cli::query::activate
2.27 0.399 6.137 4427 0.0001 0.0014 DBIx::Record::LoadByCol
2.16 0.380 2.453 5903 0.0001 0.0004 DBD::mysql::db::prepare
2.16 0.379 3.417 2950 0.0001 0.0012 RT::Ticket::Owner
AFTER:
Total Elapsed Time = 46.81828 Seconds
User+System Time = 14.50828 Seconds
Exclusive Times
%Time ExclSec CumulS #Calls sec/call Csec/c Name
11.0 1.609 14.573 1 1.6094 14.572 rt::ui::cli::query::ParseArgs
7.78 1.129 2.246 4426 0.0003 0.0005 DBIx::EasySearch::Limit
7.51 1.090 1.083 2953 0.0004 0.0004 DBI::st::execute
7.30 1.059 1.554 13275 0.0001 0.0001 RT::Record::_Value
5.09 0.739 1.134 5903 0.0001 0.0002 DBD::_::st::fetchrow_hashref
4.96 0.720 0.797 4426 0.0002 0.0002 DBIx::EasySearch::_GenericRestrict
ion
4.44 0.644 15.411 1 0.6442 15.410 rt::ui::cli::query::activate
3.74 0.543 3.902 1476 0.0004 0.0026 DBIx::EasySearch::_DoSearch
2.96 0.429 3.488 2950 0.0001 0.0012 RT::Ticket::Owner
2.76 0.400 0.367 13275 0.0000 0.0000 DBIx::Record::_Value
2.76 0.400 4.375 4426 0.0001 0.0010 DBIx::EasySearch::Next
2.27 0.330 0.603 2955 0.0001 0.0002 DBI::_new_handle
2.21 0.320 2.544 4425 0.0001 0.0006 RT::Watchers::Limit
1.93 0.280 0.265 5903 0.0000 0.0000 DBI::st::fetch
1.93 0.280 0.250 11804 0.0000 0.0000 DBIx::EasySearch::_isLimited
--
jesse reed vincent --- root at eruditorum.org --- jesse at fsck.com
pgp keyprint: 50 41 9C 03 D0 BC BC C8 2C B9 77 26 6F E1 EB 91
-------------------------------------------------------------
As I sit here alone looking at green text on a laptop in a mostly bare room listening
to loud music wearing all black, I realize that that it is much less cool in real life :)
--Richard Tibbets
More information about the Rt-devel
mailing list