I am using V8 as part of Node and have written a Javascript implementation of Bitcask, using a Javascript object as a hash to keep file offsets in memory.
This object has 7 million entries and I'm noticing that while the JS code is resting, doing nothing, V8 is hitting 100% CPU every few seconds and doing this continually.
Attached is the full result of running V8 with --prof.
And of particular interest:
[C++]:
ticks total nonlib name
73615 43.1% 43.1% v8::internal::StaticMarkingVisitor::VisitUnmarkedObjects
68436 40.1% 40.1% _accept$NOCANCEL
4796 2.8% 2.8% v8::internal::FlexibleBodyVisitor<v8::internal::StaticMarkingVisitor, v8::internal::JSObject::BodyDescriptor, void>::VisitSpecialized<40>
Should I be using many smaller hashes to keep this overhead down? i.e. some sort of sparse hash implementation? Or using key mod 1000 to determine the hash it should be in?
Does V8 have limits on hash table sizes?
Thanks.