-
-
Notifications
You must be signed in to change notification settings - Fork 44
SQLiteJournal: performance improvements #34
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
Conversation
e32571a to
4e8833f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point when there are no foreign keys.
|
Could you change commit message to be consistent and add test to priority bugfix? |
|
I have updated the test file already. |
This should be in separate PR (or commit at least). |
disabled foreign keys check removed unnecessary indices enabled journal_mode WAL
4e8833f to
cd0583a
Compare
|
I have created a new PR #35 for the bug fix. |
|
With following synthetic benchmark: use Nette\Caching\Cache;
use Nette\Caching\Storages\SQLiteJournal;
require __DIR__ . '/../caching/vendor/autoload.php';
$keys = $tags = $dels = [];
foreach (range(1, 200) as $i) {
$keys[] = "key-$i";
$tags[] = "tag-$i";
if (($i % 4) === 0) $dels[] = "tag-$i";
}
$journal = new SQLiteJournal(__DIR__ . '/bench.s3db');
foreach (range(1, 10) as $loop) {
# One key, multiple tags
$journal->write('key', [Cache::TAGS => $tags]);
# n-keys, one tag
foreach ($keys as $key) {
$journal->write($key, [Cache::TAGS => ['tag']]);
}
# Delete some of tags
$journal->clean([Cache::TAGS => $dels]);
}Apache sequential bench: Apache parallel bench: So 👍 for merge. |
|
@sallyx Could you change the commit message to something like: |
|
@sallyx not title but commit message |
disabled foreign keys check removed unnecessary indices enabled journal_mode WAL
SQLiteJournal: performance improvements