Repository navigation
This version:
- Improves performance of scheme field cache renewal.
- Improves performance of classification group clustering.
- Improves preference handling to reduce unnecessary database operations and avoid creating cookies for anonymous users unless preferences are saved.
Improved scheme field cache renewal performance
The database function used to populate scheme field caches was optimised, significantly reducing cache renewal times, particularly for large cgMLST schemes. The revised implementation uses a two-stage matching process to identify candidate profiles before performing full allele profile comparisons, avoiding the overhead of generating and executing SQL queries containing thousands of individual locus conditions.
Benchmarking demonstrated reductions in cache renewal times of approximately 73% for a 2,133-locus scheme and 18% for a 1,329-locus scheme. Smaller schemes showed no measurable performance regression. The optimised implementation produced identical cache results to the original, including for schemes with text allele identifiers and isolates matching multiple scheme profiles.
Improved performance of classification group clustering
The performance of classification group clustering (cluster.pl) has been significantly improved, particularly for large datasets and schemes containing many loci.
- Reworked the PostgreSQL matching functions to compare allele profiles using the existing scheme warehouse arrays, avoiding expensive joins against individual allele designations.
- Added early termination of absolute-threshold comparisons when the permitted number of mismatches is exceeded.
- Optimised relative-threshold comparisons while preserving the existing handling of missing allele designations.
- Reduced unnecessary database queries, job-status updates, and repeated processing within
cluster.pl. - Improved classification group merging by replacing row-by-row database updates with set-based operations.
Benchmarks showed more than 20-fold improvements in clustering performance, with identical classification results. The improvements apply to both absolute and relative mismatch thresholds and retain support for text-based allele identifiers.
Improved preference handling
Preference handling has been refactored to improve efficiency and reduce unnecessary database activity. Anonymous users are no longer assigned a GUID cookie simply by browsing the database; one is created only when needed to save preferences. Preference initialisation has also been streamlined to avoid unnecessary database queries and updates, with additional caching of scheme metadata to reduce repeated lookups. These changes reduce the load on the preferences database, particularly for pages that make multiple requests, such as dashboards, while preserving existing preference functionality for both anonymous and logged-in users.
Full Changelog: v_1.55.2...v_1.56.0