[Koha-bugs] [Bug 30169] New: Prefetching is expensive for performance

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Feb 23 18:28:52 CET 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30169

            Bug ID: 30169
           Summary: Prefetching is expensive for performance
 Change sponsored?: ---
           Product: Koha
           Version: master
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P5 - low
         Component: Architecture, internals, and plumbing
          Assignee: koha-bugs at lists.koha-community.org
          Reporter: nick at bywatersolutions.com
        QA Contact: testopia at bugs.koha-community.org

When working on bug 30168 I checked out 500 items to a patron to test
performance

I found that after adding the prefetch, things were worse.

Testing on command line seems to suggest prefetch is worse than repeated
fetches

time perl -e 'use Koha::Checkouts; for( my $i=0;$i<500;$i++){
Koha::Checkouts->find({itemnumber=>541}) } print "2\n";'
2
real    0m1.850s
user    0m1.701s
sys     0m0.096s

root at kohadevbox:koha(master)$ time perl -e 'use Koha::Checkouts; for( my
$i=0;$i<500;$i++){ Koha::Checkouts->find({itemnumber=>541},{prefetch =>
['itemnumber','borrowernumber']}) } print "2\n";'
2

real    0m10.770s
user    0m10.452s
sys     0m0.104s

root at kohadevbox:koha(master)$ time perl -e 'use Koha::Checkouts; for( my
$i=0;$i<500;$i++){ my $co =Koha::Checkouts->find({itemnumber=>541},{prefetch =>
['itemnumber','borrowernumber']}); my $item = $co->item; my $pat = $co->patron
} print "2\n";'
2

real    0m13.153s
user    0m12.600s
sys     0m0.140s

root at kohadevbox:koha(master)$ time perl -e 'use Koha::Checkouts; for( my
$i=0;$i<500;$i++){ my $co =Koha::Checkouts->find({itemnumber=>541}); my $item =
$co->item; my $pat = $co->patron } print "2\n";'
2

real    0m3.873s
user    0m3.493s
sys     0m0.139s

-- 
You are receiving this mail because:
You are watching all bug changes.
You are the assignee for the bug.


More information about the Koha-bugs mailing list