Repository navigation
v1.9.1
#44
Replies: 1 comment
NeoSQLite Benchmark ResultsDate: 202603131642 Summary
Category Results
NotesPartial Comparisons (one side skipped):
|
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
NeoSQLite v1.9.1 Release Notes
TL;DR
🔧 Maintenance Release — Configurable Journal Mode & Performance Optimizations
Overview
NeoSQLite v1.9.1 is a maintenance and optimization release that introduces configurable SQLite journal modes and significant cursor performance improvements. This version focuses on providing flexibility for specialized deployment environments while maintaining full PyMongo API compatibility.
Key Achievement: With this release, NeoSQLite provides production-grade flexibility for SQLite deployment scenarios, allowing developers to choose the optimal journal mode for their specific use case while maintaining ACID compliance and PyMongo API parity.
Major Feature: Configurable Journal Mode
Full support for SQLite journal mode configuration via
Connectionconstructor:Journal Mode Options
API Usage
Type Safety
JournalModeclass - Enum-like class with validated constantsValueErrorfor invalid modesPerformance: SQL-Tier Cursor Optimization
Significant cursor performance improvements by moving operations to SQL level:
Cursor Optimizations
sort()Optimization:ORDER BYclauselimit()andskip()Optimization:LIMITandOFFSETclausesAutomatic Tier Selection:
Performance Impact
Benchmark Mode: Automated Performance Testing
Integrated benchmark capabilities into the existing API comparison suite:
Benchmark Features
Multiple Iterations:
Comprehensive Coverage:
Report Generation:
Usage
Benchmark Scripts
Shell Script:
Implementation Details
Core Improvements
Query Helper Enhancements:
_build_sort_clause()- SQL ORDER BY generation_build_pagination_clause()- SQL LIMIT/OFFSET generationCursor State Tracking:
_sql_handled_sort- Track if SQL handled sorting_sql_handled_pagination- Track if SQL handled paginationConnection Cloning:
with_options()Test Suite Reorganization:
new_operators.pyinto focused modulesaggregation_bucket.py,type_operators.py,expression_operators.py,object_operators_extended.py,array_operators_extended.py,binary_operators.pyNew Test Suites
tests/test_journal_mode.py- Journal mode configuration and validation testsexamples/api_comparison/timing.py- Timing utilities for benchmarkingexamples/api_comparison/reporter.py- BenchmarkReporter class for resultsexamples/api_comparison/runner.py-run_benchmark()functionBenchmark Infrastructure
Timing Utilities:
start_neo_timing()/end_neo_timing()- NeoSQLite timingstart_mongo_timing()/end_mongo_timing()- MongoDB timingget_last_neo_timing()/get_last_mongo_timing()- Retrieve last timingBenchmark Reporter:
BenchmarkResultclass - Per-category timing storageBenchmarkReporterclass - Aggregate results and reportingBenchmark Scripts:
scripts/run-api-benchmark.sh- Automated benchmark runnerTest Results
Unit Tests
All existing tests pass without modification, confirming 100% backward compatibility:
Journal Mode Tests
New test coverage for journal mode functionality:
API Comparison Tests
*Test count decreased due to deduplication during module reorganization.
Benefits for Users
For Application Developers
Journal Mode Flexibility: Choose the optimal journal mode for your deployment scenario.
Better Cursor Performance: Faster queries with sort/limit/skip operations.
No Breaking Changes: All existing code continues to work without modification.
Production-Ready: WAL mode as default provides best concurrency for most applications.
For DevOps
NFS Support: Use DELETE mode for NFS deployments where WAL is problematic.
Single-File Distribution: DELETE mode ensures database is single file when closed.
Memory-Constrained Environments: MEMORY or OFF modes for specific use cases.
For Contributors
Benchmark Infrastructure: Easy to measure performance impact of changes.
Modular Test Organization: Easier to maintain and extend test suite.
Clear Architecture: SQL-tier optimization patterns well-documented.
Migration Guide
Upgrading from v1.9.0
Steps:
pip install neosqlite==1.9.1Effort: Minimal — typically 5-10 minutes for most users.
Adopting Journal Mode Configuration
Default Behavior (no code changes):
NFS Deployment:
Single-File Distribution:
Maximum Performance (no crash recovery needed):
Using Benchmark Mode
Quick Benchmark:
Automated Benchmarking:
Analyze Results:
documents/benchmarks/Benchmark-NeoSQLite-1.9.1-YYYYMMDDHHMM.mddocuments/benchmarks/Benchmark-NeoSQLite-1.9.1-YYYYMMDDHHMM.csvKnown Limitations
Journal Mode Considerations
WAL Mode:
-waland-shmfiles alongside databaseDELETE Mode:
MEMORY/OFF Modes:
Cursor Optimization Limitations
Python Fallback Required When:
$exprfilters that can't be translated to SQL$wherepredicates using Python functionsPerformance Impact:
Acknowledgments
This release represents a focused investment in production flexibility and performance optimization. The addition of configurable journal modes makes NeoSQLite suitable for a wider range of deployment scenarios, while cursor optimizations provide tangible performance benefits for common query patterns.
The benchmark infrastructure establishes a foundation for data-driven performance improvements, enabling systematic optimization based on empirical measurements.
NeoSQLite v1.9.1 — Flexible Deployment, Optimized Performance.
This discussion was created from the release v1.9.1.
All reactions