llnode icon indicating copy to clipboard operation
llnode copied to clipboard

Make `v8 findjsobjects` faster

Open mmarchini opened this issue 5 years ago • 0 comments

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):

image

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)

mmarchini avatar Oct 04 '18 22:10 mmarchini