Bug 23377: use ENV syspref override instead of complete disable
commit528ac9395045044e6204b130e01d9b00e0c6268a
authorIan Walls <ian@bywatersolutions.com>
Wed, 31 Jul 2019 16:32:23 +0000 (31 16:32 +0000)
committerLucas Gass <lucas@bywatersolutions.com>
Thu, 6 Feb 2020 14:41:11 +0000 (6 14:41 +0000)
tree15a0fd50964fb57a6402711af7ff299f9c652d0f
parent936a69aba75061b3323daa657cbc21c3d27b5403
Bug 23377: use ENV syspref override instead of complete disable

In an attempt to save time, bulkmarcimport temporarily sets CataloguingLog
and AuthoritiesLog to 0.  It does this by disabling syspref caching and saving
the changes to the database (then replacing the original values at completion).

Unfortunately, this disables other key sysprefs from being cached, and results in
a 50% increase in processing time for the script.

This patch instead utilizes the ENV variable override feature of sysprefs, which
preempts the cache in C4::Context->preference().

To test:
1. Perform a bulkmarcimport with a reasonable number of biblios (~1000 will do)
2. Note the time taken to complete
3. Apply patch
4. Revert the biblio load performed
5. Perform another bulkmarcimport with the same biblios and commandline options
6. Note the time taken to complete
7. Compare times.  The time from step 6 should be about 33% less than the time from step 2
8. Check Cataloguing and Authorities Logs to verify imported records were not logged
9. Profit!

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Joy Nelson <joy@bywatersolutions.com>
(cherry picked from commit 91befb973d9b646b15c78ba535348fa2cf139639)

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
misc/migration_tools/bulkmarcimport.pl