Repository navigation
Some performance changes in utils and caching - #35
Merged
Merged
Conversation
Update test commands in justfile, AGENTS.md, and CI workflow to use --allow-env --allow-read --allow-write --allow-ffi --allow-net for Deno tests. This ensures tests have necessary permissions for all features.
conditions Clean stale cache entries for a specific endpoint using base URL pattern matching. This prevents race conditions when multiple endpoints are fetched in parallel. Remove noisy console warnings from cache logic. Improve logging in fetchNewDataFromAPIandStore.
Owner
Author
|
🎉 This PR is included in version 1.12.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a prepared statement cache for SQLite queries in the
cache.tshelper, improving performance and resource management by reusing prepared statements and cleaning them up properly. It also adds comprehensive tests for cache functionality, updates documentation and developer commands to usejust, and expands the permissions for running tests.Prepared statement caching and cache improvements:
statementCacheusing aWeakMapto cache prepared SQLite statements by database and column, with helper functionsgetCachedStatementandcleanupStatementCacheto manage statement lifecycle and prevent memory leaks. TherequestFromCachefunction now uses this cache for improved efficiency. [1] [2]statementCache,getCachedStatement) for testing purposes.Testing enhancements:
cache.test.tsthat thoroughly tests statement caching, cache cleanup, and all cache operations includingupdateCache,deleteCache,cleanCache, andrequestFromCache.Developer workflow and documentation:
justfileand documentation (AGENTS.md) to usejustfor all developer commands, replacing directdenocalls and adding new recipes for common tasks. [1] [2]deno testin CI and local runs to include--allow-read,--allow-write,--allow-ffi, and--allow-netfor broader test coverage. [1] [2] [3]Utility function improvement:
uniqfunction inutils.tsto use aSetfor more efficient duplicate removal based on theuidproperty.