Skip to content

flash: Optimize away redundant file reads - #269

Merged
sampsyo merged 2 commits into
mainfrom
flash-opt-dedup
May 25, 2026
Merged

sampsyo merged 2 commits into
mainfrom
flash-opt-dedup

Conversation

@sampsyo

@sampsyo sampsyo commented May 24, 2026

Copy link
Copy Markdown
Collaborator

Because it comes up in our target workload (which opens the same GFA from multiple odgi commands), this attempts to optimize redundant reads of the same file to only do a single read. This doesn't matter much map-file which is presumably very fast, but it feels nice and could potentially actually matter in other situations.

In a little experiment, I am surprised to see that this might have actually saved a little bit of time:

  • before: 395.4 ms ± 2.4 ms
  • after: 387.1 ms ± 2.6 ms

I didn't expect anything at all, so even a tiny delta is worth celebrating, I guess. 🎉

This is essentially a very restricted CSE optimization. We could generalize it much further if we run into cases where it would be helpful...

sampsyo added 2 commits May 24, 2026 12:07
Because it comes up in our target workload (which opens the same GFA
from multiple odgi commands), this attempts to optimize redundant reads
of the same file to only do a single read. This probably doesn't matter
at all for `map-file` which is presumably very fast, but it feels nice
and could potentially actually matter in other situations.

In a little experiment, I am surprised to see that this might have
actually saved a *little* bit of time:
* before: 395.4 ms ±   2.4 ms
* after:  387.1 ms ±   2.6 ms

I didn't expect anything at all, so even a tiny delta is worth
celebrating, I guess.

This is a very restricted CSE optimization. We could generalize it much
further if we run into cases where it would be helpful...
Just trying to isolate the effects of all the optimizations we have now.
@sampsyo sampsyo mentioned this pull request May 24, 2026
17 tasks
@sampsyo
sampsyo merged commit 1b7fa36 into main May 25, 2026
8 checks passed
@sampsyo
sampsyo deleted the flash-opt-dedup branch May 25, 2026 22:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant