notify
notify copied to clipboard
Investigate ways to minimise the amount of PathBufs
We're allocating a lot of PathBuf
s all over the place (often by cloning). Reducing this would improve performance for Notify's runtime. Some notes:
- We probably want to own them. References are a mess, but
Rc
s/Arc
s would work okay. - Beyond just removing a lot of copies of the same path, it should be possible to optimise the number of copies of path segments there are. Ideally, if both
/a/b/c
,/a/s/d
, and/a/b/e
are in Notify in various places, only one each ofa
,b
,c
,d
,e
, ands
would be allocated. - Whatever solution needs to convert cleanly to
Path
orPathBuf
for the public API. - Whatever solution needs to work equally well under all platforms, with all styles of paths (think windows network paths...)
- Probably ought to think about URLs as well, if nothing else than to support RedoxOS (eventually, down the line).
- If possible, this optimisation should hold for the entire process, instead of just one instance of Notify.
Need to investigate existing solutions before building a custom one, if possible.
- Possibly also handle inodes where available?
Some benchmarking of various solutions indicates that simply wrapping most PathBuf
s in Arc
yields the largest improvement, and that should be simple enough as a good start.