Slow Method could be improved
blundell opened this issue · 7 comments
where does that recommended time come from?
I have no idea what reference they have for that. Isn't it the time per frame before jank?
could be the time ignoring GC
¯_(ツ)_/¯
Using TimingLogger we determined this is the line that causes the slow down for this
String[] sqls = assets.list(migrationsPath);
(Migrations:121)
The issue only arises when you have a certain number of migration files (device dependent) 10_ migration files in our case.
Considering alternative solutions, we can't speed up assets.list
as it is a framework class.
We could move all assets
to res/xml
as these would be compiled and the name references would be available instantly, however this is a breaking api change and not being considered right now.
We could also allow the library user to pass the number of the file wanting to be used so that this lookup is not needed. However this might not be possible due to the creation time and also it defeats half the point of having the migration file (vs the normal version number declaration).
So right now this is a WILL NOT FIX.
[[selfie-0 uploading...]]
is the beef that this is working on the main thread?
yeah, don't think it can be backgrounded ... it's instantiating the content provider