We're in the process of switching over from an in-house ORM to Rose.  So
far things are going great!  However, when we ran a profiler on one of our
tests we noticed that we were spending a lot of time in some pretty low
level rose methods:

[EMAIL PROTECTED] mercury]# grep Rose pre|head -7
%Time    Sec.     #calls   sec/call  F  name
 6.02    8.9952   717820   0.000013    
Rose::DB::Object::Metadata::Column::name
 4.84    7.2383      359   0.020162    
Rose::DB::Object::QueryBuilder::build_select
 4.05    6.0488      567   0.010668     Rose::DB::Object::Metadata::columns
 2.82    4.2211      811   0.005205     Rose::DB::Object::load
 2.78    4.1585   157459   0.000026    
<anon>:.../5.8.5/Rose/DB/Object.pm:344
 1.13    1.6901    32070   0.000053     Rose::DB::Object::Metadata::column
 0.73    1.0943      359   0.003048    
Rose::DB::Object::Manager::get_objects

For reference we spent 18 seconds in DB::st::execute.  Looking through the
code, I found a few place where columns were doubly sorted by name.  Also,
switching other name sorts to Schwartzian transforms got a big boost as
well.    Here's the post-patch benchmark:

[EMAIL PROTECTED] mercury]# grep Rose post|head -7
 5.01    5.8684      359   0.016346    
Rose::DB::Object::QueryBuilder::build_select
 3.29    3.8590      811   0.004758     Rose::DB::Object::load
 3.19    3.7388   372712   0.000010    
Rose::DB::Object::Metadata::Column::name
 3.08    3.6098   157459   0.000023    
<anon>:.../5.8.5/Rose/DB/Object.pm:344
 1.17    1.3705    32070   0.000043     Rose::DB::Object::Metadata::column
 0.74    0.8672      359   0.002416    
Rose::DB::Object::Manager::get_objects
 0.67    0.7882      567   0.001390     Rose::DB::Object::Metadata::columns

Total savings of 25-30 seconds.  I've attached the patch against 0.764. 
Thanks!

    --Nate

Attachment: patch
Description: Binary data

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to