[mobile][photos] Reduce GC events when loading models (#1223)
## Description When using `readAsBytes()`, noticed a lot of `concurrentMark` GC event in timeline when using the performance profiler dev tool, which were potentially causing longer build and raster time for frames.
This commit is contained in:
commit
be62ea1459
2 changed files with 4 additions and 3 deletions
|
@ -15,9 +15,10 @@ class OnnxImageEncoder {
|
|||
..setIntraOpNumThreads(1)
|
||||
..setSessionGraphOptimizationLevel(GraphOptimizationLevel.ortEnableAll);
|
||||
try {
|
||||
final bytes = await File(args["imageModelPath"]).readAsBytes();
|
||||
final session = OrtSession.fromBuffer(bytes, sessionOptions);
|
||||
final session =
|
||||
OrtSession.fromFile(File(args["imageModelPath"]), sessionOptions);
|
||||
_logger.info('image model loaded');
|
||||
|
||||
return session.address;
|
||||
} catch (e, s) {
|
||||
_logger.severe(e, s);
|
||||
|
|
|
@ -12,7 +12,7 @@ description: ente photos application
|
|||
# Read more about iOS versioning at
|
||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||
|
||||
version: 0.8.71+591
|
||||
version: 0.8.72+592
|
||||
publish_to: none
|
||||
|
||||
environment:
|
||||
|
|
Loading…
Add table
Reference in a new issue