notify icon indicating copy to clipboard operation
notify copied to clipboard

Investigate ways to minimise the amount of PathBufs

Open passcod opened this issue 5 years ago • 1 comments

We're allocating a lot of PathBufs 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 Rcs/Arcs 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 of a, b, c, d, e, and s would be allocated.
  • Whatever solution needs to convert cleanly to Path or PathBuf 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?

passcod avatar Apr 23 '19 02:04 passcod

Some benchmarking of various solutions indicates that simply wrapping most PathBufs in Arc yields the largest improvement, and that should be simple enough as a good start.

passcod avatar Apr 26 '19 03:04 passcod