Bugzilla – Attachment 53215 Details for
Bug 16076
DBIx searches - performance issues
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 16076 - DBIx searches - performance issues
Bug-16076---DBIx-searches---performance-issues.patch (text/plain), 2.32 KB, created by
Jacek Ablewicz
on 2016-07-08 09:51:45 UTC
(
hide
)
Description:
Bug 16076 - DBIx searches - performance issues
Filename:
MIME Type:
Creator:
Jacek Ablewicz
Created:
2016-07-08 09:51:45 UTC
Size:
2.32 KB
patch
obsolete
>From 60ef96960f262a98b80dfb586e967dda911a977c Mon Sep 17 00:00:00 2001 >From: Jacek Ablewicz <abl@biblos.pk.edu.pl> >Date: Fri, 8 Jul 2016 11:42:48 +0200 >Subject: [PATCH] Bug 16076 - DBIx searches - performance issues > >Quick & dirty test script for benchmarking database search performance >using various DBI and DBIx approaches. >--- > .../_dbix_test_search_performance_all_sysprefs.pl | 56 ++++++++++++++++++++ > 1 file changed, 56 insertions(+) > create mode 100755 misc/tests/_dbix_test_search_performance_all_sysprefs.pl > >diff --git a/misc/tests/_dbix_test_search_performance_all_sysprefs.pl b/misc/tests/_dbix_test_search_performance_all_sysprefs.pl >new file mode 100755 >index 0000000..02f2f2a >--- /dev/null >+++ b/misc/tests/_dbix_test_search_performance_all_sysprefs.pl >@@ -0,0 +1,56 @@ >+#!/usr/bin/perl >+ >+use Modern::Perl; >+use Koha::Config::SysPrefs; >+ >+my $results; >+ >+for (1..1000) { >+ $results = sysprefs_from_mysql(); ## 1.82 msec >+ ## $results = sysprefs_dbix_hashref_inflator(); ## 12.5 msec >+ ## $results = sysprefs_dbix_unblessed(); ## 17.6 msec >+ >+ ## Note: numbers above are results for current master (08/07/2016) >+ ## on Wheezy (DBIx::Class version 0.08196), i7-3770 CPU @ 3.40GHz. >+ ## >+ ## For 3.22.x on Jessie (DBIx 0.082810, i7-930 CPU @ 2.80GHz) >+ ## there is a huge difference: >+ ## >+ ## $results = sysprefs_from_mysql(); ## 2.52 msec >+ ## $results = sysprefs_dbix_hashref_inflator(); ## 3.51 msec >+ ## $results = sysprefs_dbix_unblessed(); ## 7.9 msec >+ ## >+ ## DBIx search with DBIx::Class::ResultClass::HashRefInflator >+ ## attribute is (almost) as fast as plain DBI search. >+} >+ >+print "Got ".scalar(@$results)." sysprefs\n"; >+ >+sub sysprefs_dbix_unblessed { >+ my $all_prefs = Koha::Config::SysPrefs->search( >+ undef, >+ { columns => [qw/value variable/] } >+ )->unblessed(); >+ >+ $all_prefs; >+} >+ >+sub sysprefs_dbix_hashref_inflator { >+ my $all_prefs = Koha::Config::SysPrefs->search_all_unblessed( >+ undef, >+ { columns => [qw/value variable/] } >+ ); >+ >+ $all_prefs; >+} >+ >+sub sysprefs_from_mysql { >+ my $dbh = C4::Context->dbh(); >+ my $sql = 'SELECT variable, value FROM systempreferences'; >+ >+ my $sth = $dbh->prepare($sql); >+ $sth->execute; >+ my $result = $sth->fetchall_arrayref({}); >+ >+ $result; >+} >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 16076
:
53214
| 53215