https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42873 Bug ID: 42873 Summary: Add a faster MARCXML decoder (MARC::File::XML::Fast) for reading records Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org Target Milestone: --- This adds a faster path for decoding the MARCXML stored in biblio_metadata into MARC::Record objects, used when reading bibliographic records. Koha re-parses stored MARCXML on every read via MARC::Record::new_from_xml, which builds a full DOM and runs MARC::Field->new validation for every field. For records that were already validated when stored (bug 35104), that validation is redundant. A new module, MARC::File::XML::Fast, decodes MARCXML with a streaming XML::LibXML::Reader and builds MARC::Field objects by direct bless, skipping the per-field validation. Output is byte-identical to new_from_xml for well-formed UTF-8 MARCXML; malformed input falls back to new_from_xml so a record can never become un-decodable. The module is bundled under lib/ (like WebService::ILS) and is maintained as a standalone CPAN distribution. Koha::Biblio::Metadata->record uses it when the new UseFastMARCDecode system preference is enabled (default on). Depends on bug 35104, which guarantees stored metadata is valid MARCXML. Test plan: 1. Apply the patches, run updatedatabase and restart_all. 2. prove t/MARC/File/XML/Fast.t 3. prove t/db_dependent/Koha/Biblio/Metadata.t 4. Administration > System preferences: confirm UseFastMARCDecode exists under Cataloging > Record structure and defaults to "Use". 5. Browse several biblio detail pages; records display correctly. 6. Set UseFastMARCDecode to "Don't use"; confirm pages render identically. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.