Apparent 200ms overhead on queries in Flutter application, vs query from tools #3131
Replies: 1 comment
-
Are you using something like this interceptor to measure query runtime? It's worth noting that that also includes the time to make the request to the remote isolate and deserialize the responses. 200ms of overhead does seem like a lot though, especially since the query is not returning a lot of rows. Are you seeing similar overhead results for inserts/updates (or generally statements that don't return any rows at all) as well? Do the rows contain any particularly large string values or anything else that might come to mind? |
Beta Was this translation helpful? Give feedback.
-
I'm doing a performance tuning pass on our application, and would like some ideas of what could be going on (with a mind to mitigate of course).
Im tracing the application on MacOS as that is where I have all my tooling.
A large database table (5000 records) is being queried in the application, paged, 20 rows at a time.
The drift trace/logging reports the query to execute in a fairly consistent 550ms.
I take the same query SQL generated by drift, and execute it using DataGrip, against the same database file, and it executes in 350ms.
Finally, I've run the same query on the command line using sqlite3 terminal (with profiling enabled) it takes 294ms.
So, I see an average of 200ms overhead inside the flutter application (target platform MacOS, not iOS).
Indexing and query optimization aside, any idea of why such a large disparity?
These are my startup pragmas - I tweaked the cache up and down, until the query time was at its minimum of 550ms.
Beta Was this translation helpful? Give feedback.
All reactions