SQLCipher for Android Performance Issue

Thank your for your reply. That’s a lot of questions to go through. Is there something I can try first which might be enough?

To answer some of those questions:

  1. How much data? - On first launch, the app creates a new database (not encrypted) about 50MB in size
  2. I guess a single connection. I open a new database, attach about 5 other databases (about 3 encrypted with different keys) and execute the inserts
  3. I use execute("ATTACH DATABASE '$pathString' AS $handle KEY '$password'")
  4. wal mode is not enabled, and on completion of inserts I execute:

sqldb.execute("PRAGMA synchronous = FULL")
sqldb.execute("analyze")

  1. I don’t think the application is doing anything else during this time. Note - the only change is the sqlcipher version - all other code is the same
  2. I’m not sure if it’s relevant how connections are managed. This is simply a creation of database, attach some other databases, execute inserts and tidy-up (see 4). That’s all done on the same sqlite database/connection
  3. This was tested on a Pixel 7a