Use heap parsing for objprof
commit241ab37ce374c7e1cd6f652c4a883816f7256838
authorEdwin Smith <smith@fb.com>
Mon, 1 Dec 2014 19:15:03 +0000 (1 11:15 -0800)
committerhhvm-bot <hhvm-bot@fb.com>
Mon, 8 Dec 2014 21:30:31 +0000 (8 13:30 -0800)
tree936138d200bf1c86e841b4b212ccee840e852fba
parent40f9d9547b3e13767575534686e5e1b061d2d029
Use heap parsing for objprof

Summary: Parsable heap means we don't need a hashtable to keep track of objects.
Change heap iteration to take a snapshot of the objects in the heap,
then iterate over them. Populating a vector of pointers is probably more
efficient than using the unordered_set for a single snapshot, but could
lose if many snapshots are taken in the same request.

Looking at the inner loop code in objprof_get_data/strings, I don't think
the snapshot cost is significant; they're converting objects to arrays,
accessing the arrays, and so on. Taking a snapshot also avoids mutating
the heap (allocating arrays, etc) while we are iterating over it.

Reviewed By: @markw65

Differential Revision: D1711579
NEWS
hphp/runtime/base/memory-manager-defs.h [new file with mode: 0644]
hphp/runtime/base/memory-manager-inl.h
hphp/runtime/base/memory-manager.cpp
hphp/runtime/base/memory-manager.h
hphp/runtime/base/object-data.cpp
hphp/runtime/base/object-data.h
hphp/runtime/ext/ext_objprof.cpp
hphp/test/slow/objprof/objprof.php