Replies: 3 comments 2 replies
-
Hi, thanks for the report! Attaching a profiler to the app to understand where in drift the slowdown is coming from would definitely be helpful. Also, can you share the code opening the database (e.g. the |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply! Here is the code I use to open the database: LazyDatabase _openConnection() {
return LazyDatabase(() async {
final dbFolder = await getApplicationDocumentsDirectory();
final file = File(p.join(dbFolder.path, 'db.sqlite'));
if (!await file.exists()) {
final content = await rootBundle.load('assets/db.sqlite');
await file.writeAsBytes(content.buffer.asUint8List());
}
if (Platform.isAndroid) {
await applyWorkaroundToOpenSqlite3OnOldAndroidVersions();
}
return NativeDatabase(file, logStatements: kDebugMode, cachePreparedStatements: true);
});
} So no, I'm not using |
Beta Was this translation helpful? Give feedback.
-
Previously, with moor I used the following setup:
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I'm maintaining a Flutter app that was previously built with Moor on Flutter 3.7.8. We've recently migrated to Drift and upgraded Flutter to 3.24.
After the migration, we've noticed a significant performance drop, especially in the UI responsiveness. The app feels much more sluggish compared to the previous version — even when no heavy database operations are actively running.
I understand that we have some optimization to do in our queries (e.g., avoiding redundant lookups), but the performance difference is so noticeable that we suspect something else might be contributing to this.
Some additional info:
cachePreparedStatements: true
So the questions are:
Thanks a lot in advance — we love Drift, just trying to get things smooth again!
Beta Was this translation helpful? Give feedback.
All reactions