kxxt / tracexec

Tracer for execve{,at} and pre-exec behavior, launcher for debuggers.
GNU General Public License v2.0
192 stars 3 forks source link

[Performance] Optimize memory usage #24

Open kxxt opened 1 month ago

kxxt commented 1 month ago

For now there's lots of clones involved in the code. We could use something like https://github.com/thomcc/arcstr to optimize the memory footprint.

The tui can already handle 100000 events with a very low idle cpu usage without hassle thanks to the complex multi-layer cache system I implemented. But the memory usage doesn't look nice to me (total ram 16GB).

image

kxxt commented 1 month ago

The search feature caches all the lines in string representation to make it memory-contiguous, which would double the memory usage. Ideally the regex should be able to work on chunks of strs : https://github.com/rust-lang/regex/issues/425 . Maybe I should give https://github.com/pascalkuthe/regex-cursor a try