Subject: | Journaling slows schema loading way, way, way down... |
I have an application with a fairly large database. It was a little
slow to startup before I tried using DBIx::Class::Journal...
% time perl -Ilib -MMyApp::DB=journal,0 -e1
real 0m10.776s
user 0m4.945s
sys 0m0.252s
Adding a journal sent the startup time spiraling from annoying to
unbearable...
% time perl -Ilib MyApp::DB=journal,1 -e1
real 3m15.309s
user 3m7.045s
sys 0m1.569s
Devel::NYTProf reports that this is primarily due to increased calls to
Class::C3...
With journaling...
Statements Executed: 25,252,916
Total Time: 375.849319996173 seconds
Top offenders...
52,944 Class::C3::_apply_method_dispatch_table
52,934 Class::C3::_remove_method_dispatch_table
Without journaling...
Statements Executed: 11,465
Total Time: 0.115147999999999 seconds
31 Class::C3::_apply_method_dispatch_table
0 Class::C3::_remove_method_dispatch_table
I attempted to fix this by temporarily overriding
Class::C3::reinitialize, but that caused some of the test suite to fail.
If I can figure out where it's safe to do that, I'll provide a patch as
well...
--
www.jasonkohles.com