llnode
llnode copied to clipboard
Make `v8 findjsobjects` faster
The first time we run v8 findjsobjects
can be very slow. Maybe there's nothing we can do about it, but I think we can try to make it faster (at least a little bit).
I generated a flamegraph of a 1.6Gb core analysis, and most time we're running LoadPtr
(which is kinda expected):
A few optimization ideas:
- Parallelism (assuming lldb::SBProcess::ReadPointerFromMemory is thread-safe [https://github.com/llvm-mirror/lldb/commit/bdcda4682])
- Identify sooner if an address was already visited
- Change
LoadPtr
to load regions of memory instead of single addresses, and keep a few of them cached.
(BTW, the Error
constructor could probably be optimized as well)