-
Notifications
You must be signed in to change notification settings - Fork 968
Performance/Asynchronous database backend #6360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
carljohnsen
wants to merge
355
commits into
duplicati:master
Choose a base branch
from
carljohnsen:performance/mssqlite-async
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Performance/Asynchronous database backend #6360
carljohnsen
wants to merge
355
commits into
duplicati:master
from
carljohnsen:performance/mssqlite-async
Conversation
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
…ethods and are properly async
LocalDeleteDatabase.BlockQuery
…e new async database methods
… cancellation token
…s forwards CancellationToken.None
…nd added some missing docstrings
…vironment variable, or some other way of providing a custom database configurotion
…nt variable along with new default options.
…ommit after each query.
… but had also changed
….FixEmptyMetadatasets()
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.
You can’t perform that action at this time.
This pull request migrates the database backend to Microsoft.Data.Sqlite, unlocking improved performance and enabling full support for asynchronous operations.
While it's not a proper benchmark, on my machine, running the test suite went from ~1600 seconds on the current master branch to ~1300 seconds on this branch, demonstrating a ~1.23x performance improvement purely from the new database backend.
Major changes
IDb
interface to simplify the codebase and leverage features specific toMicrosoft.Data.Sqlite
..Cast<object>()
usage to prevent runtime errors and ensure type safety.FileProcessor
to resolve a livelock during restore, improving reliability.ConfigureAwait(false)
to async database calls to avoid deadlocks and improve context management.await foreach
for collections, to fully leverage async benefits.await using
for async disposables to ensure proper resource cleanup.CancellationToken
parameters to support cooperative cancellation and responsive shutdowns.