Skip to content
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

chore: update sqlcipher [WPB-11808] #3069

Merged
merged 1 commit into from
Oct 22, 2024
Merged

Conversation

saleniuk
Copy link
Contributor

@saleniuk saleniuk commented Oct 22, 2024

StoryWPB-11808 [Android] app stalls when fetching a page of conversations from the local DB


PR Submission Checklist for internal contributors

  • The PR Title

    • conforms to the style of semantic commits messages¹ supported in Wire's Github Workflow²
    • contains a reference JIRA issue number like SQPIT-764
    • answers the question: If merged, this PR will: ... ³
  • The PR Description

    • is free of optional paragraphs and you have filled the relevant parts to the best of your ability

What's new in this PR?

Issues

The app stalls when fetching a page of conversations from the local DB.

Causes (Optional)

Queries used to fetch a page of conversations from the local DB are very complicated, use sql views and many nested left joins resulting in full table scan of messages.

Solutions

Update sql cipher to newest one (4.6.1) to use newest sqlite version (3.46.1) in our app, in which it looks like they updated and fixed something to better optimise queries so that in our case it no longer performs the SCAN Message.

Here's the comparison:

SQLite 3.42.0 (default for Andoid 14; in non-debug we use 3.44.2 which creates the same result)

image

SQLite 3.46.1 (newest one)

image


PR Post Submission Checklist for internal contributors (Optional)

  • Wire's Github Workflow has automatically linked the PR to a JIRA issue

PR Post Merge Checklist for internal contributors

  • If any soft of configuration variable was introduced by this PR, it has been added to the relevant documents and the CI jobs have been updated.

References
  1. https://sparkbox.com/foundry/semantic_commit_messages
  2. https://github.com/wireapp/.github#usage
  3. E.g. feat(conversation-list): Sort conversations by most emojis in the title #SQPIT-764.

Copy link

sonarcloud bot commented Oct 22, 2024

Copy link
Contributor

github-actions bot commented Oct 22, 2024

Test Results

3 250 tests  ±0   3 144 ✅ ±0   4m 32s ⏱️ +16s
  555 suites ±0     106 💤 ±0 
  555 files   ±0       0 ❌ ±0 

Results for commit 561225f. ± Comparison against base commit 5e8bfaf.

♻️ This comment has been updated with latest results.

@MohamadJaara MohamadJaara changed the base branch from develop to release/candidate October 22, 2024 16:14
@echoes-hq echoes-hq bot added the echoes: throughput/ci-maintenance Changes we need to do to keep CI healthy and fast label Oct 22, 2024
@MohamadJaara MohamadJaara changed the base branch from release/candidate to develop October 22, 2024 16:14
Copy link
Contributor

🐰 Bencher Report

Branchchore/update-sqlcipher
Testbedubuntu-latest

⚠️ WARNING: The following Measure does not have a Threshold. Without a Threshold, no Alerts will ever be generated!

Click here to create a new Threshold
For more information, see the Threshold documentation.
To only post results if a Threshold exists, set the --ci-only-thresholds CLI flag.

Click to view all benchmark results
BenchmarkLatencynanoseconds (ns)
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInFiles📈 view plot
⚠️ NO THRESHOLD
658,539.41
com.wire.kalium.benchmarks.logic.CoreLogicBenchmark.createObjectInMemory📈 view plot
⚠️ NO THRESHOLD
339,568,262.35
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.messageInsertionBenchmark📈 view plot
⚠️ NO THRESHOLD
934,220,668.17
com.wire.kalium.benchmarks.persistence.MessagesNoPragmaTuneBenchmark.queryMessagesBenchmark📈 view plot
⚠️ NO THRESHOLD
21,466,988.40
🐰 View full continuous benchmarking report in Bencher

@MohamadJaara MohamadJaara added this pull request to the merge queue Oct 22, 2024
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 52.71%. Comparing base (5e8bfaf) to head (561225f).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3069   +/-   ##
========================================
  Coverage    52.70%   52.71%           
========================================
  Files         1317     1317           
  Lines        51112    51112           
  Branches      4742     4742           
========================================
+ Hits         26941    26942    +1     
+ Misses       22246    22245    -1     
  Partials      1925     1925           

see 2 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e8bfaf...561225f. Read the comment docs.

@datadog-wireapp
Copy link

Datadog Report

Branch report: chore/update-sqlcipher
Commit report: d2216bb
Test service: kalium-jvm

✅ 0 Failed, 3144 Passed, 106 Skipped, 33.8s Total Time

Merged via the queue into develop with commit 2ddb183 Oct 22, 2024
29 checks passed
@MohamadJaara MohamadJaara deleted the chore/update-sqlcipher branch October 22, 2024 16:52
MohamadJaara pushed a commit that referenced this pull request Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
echoes: throughput/ci-maintenance Changes we need to do to keep CI healthy and fast 👕 size: XS type: chore 🧹
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants