If a record processor is to be used inside a loop (as in searchResults on bug 24458) it should not retrieve the frameworks information on each call.
Created attachment 104712 [details] [review] Bug 25457: Regression tests This patch implements tests on the ViewPolicy RecordProcessor filter, to assess it caches the calculated MARC subfield structure between calls. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 104713 [details] [review] Bug 25457: Make ViewPolicy cache MARC frameworks This patch implements an implicit cache of the calculated MARC subfield structures on each use of the filter. Moreover, if different frameworks are set between calls (using $processor->options) all of them are cached. To test: 1. Apply the tests patch 2. Run: $ kshell k$ prove t/db_dependent/Filter_MARC_ViewPolicy.t => FAIL: The ViewPolicy filter doesn't cache anything 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 104836 [details] [review] Bug 25457: Regression tests This patch implements tests on the ViewPolicy RecordProcessor filter, to assess it caches the calculated MARC subfield structure between calls. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 104837 [details] [review] Bug 25457: Make ViewPolicy cache MARC frameworks This patch implements an implicit cache of the calculated MARC subfield structures on each use of the filter. Moreover, if different frameworks are set between calls (using $processor->options) all of them are cached. To test: 1. Apply the tests patch 2. Run: $ kshell k$ prove t/db_dependent/Filter_MARC_ViewPolicy.t => FAIL: The ViewPolicy filter doesn't cache anything 3. Apply this patch 4. Repeat 2 => SUCCESS: Tests pass! 5. Sign off :-D Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
I don't see how it could be useful, you are calling GetMarcStructure that is doing exactly that.
(In reply to Jonathan Druart from comment #5) > I don't see how it could be useful, you are calling GetMarcStructure that is > doing exactly that. Is it storing the structure in L1?
yes of course.