Skip to content
Commit 788ec75b authored by Anton Hansson's avatar Anton Hansson
Browse files

Optimize FileSystemProvider.includeFile

When traversing a file tree using SAF, this method is called for
every file in the tree, so wasted cycles add up to quite a lot
of total time for large trees.

Optimizations:
- don't look up info not necessary by the cursor, by inspecting
  the projection columns
- remove a few redundant double-lookups, of e.g. the File path
- mark variables final where possible

On my device/file tree, this reduces the total time spent in includeFile
from ~33 seconds to ~22 seconds. This is where the majority of cycles
are spent when traversing a dir with SAF.

Bug: 130276310
Test: SAF test app
Change-Id: Ibdfc335253a90eb87795a7a4eecb8b7b89601f09
parent 46669aa7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment