Summary:
We have a lot of small-ish calls to JSC and within the bridge that add up during TTI. This gives us a way to measure them in aggregate in a reasonable way.
From the comments:
MicroProfiler is a performance profiler for measuring the cumulative impact of
a large number of small-ish calls. This is normally a problem for standard profilers
like Systrace because the overhead of the profiler itself skews the timings you
are able to collect. This is especially a problem when doing nested calls to
profiled functions, as the parent calls will contain the overhead of their profiling
plus the overhead of all their childrens' profiling.
MicroProfiler attempts to be low overhead by 1) aggregating timings in memory and
2) trying to remove estimated profiling overhead from the returned timings.
To remove estimated overhead, at the beginning of each trace we calculate the
average cost of profiling a no-op code section, as well as invoking the average
cost of invoking the system clock. The former is subtracted out for each child
profiler section that is invoked within a parent profiler section. The latter is
subtracted from each section, child or not.
The usage is similar to Systrace: you put a MICRO_PROFILER_BLOCK in the block you want to profile and C++ RAII will handle timing it.
After MicroProfiler::stopProfiling() is called, a table of tracing data is emitted
to glog (which shows up in logcat on Android).
Differential Revision: D3635319
fbshipit-source-id: 01390b8ac76a68dd425cba2adfdde6e4957440cc
Summary: Add a new interface to JSC that allows loading a file lazily from disk, i.e. using mmap, instead of loading the whole file upfront and copying into the VM.
Reviewed By: michalgr
Differential Revision: D3534042
fbshipit-source-id: 98b193cc7b7e33248073e2556ea94ce3391507c7
Summary: JSCExecutor has something like this, but for methods on JSCExecutor itself. Open to better ideas around how to share code
Reviewed By: lexs
Differential Revision: D3516314
fbshipit-source-id: 4b1265916c52d582bb0b9348e9b4a099f566d6c9
Summary:
Adds:
- getType so you can switch on type
- getPrivate
Reviewed By: lexs
Differential Revision: D3515510
fbshipit-source-id: d574b04f563ac650bacec3751b50be6345e8439a
Summary:
Adds:
- callAsConstructor
- Ability to provide `this` object to callAsFunction
- getPropertyNames() now returns Strings (which can be converted by the caller to std::string if they want).
Fixes:
- double free issue with the String move constructor
Reviewed By: lexs
Differential Revision: D3515398
fbshipit-source-id: afa1342044e41fdd833dd27b8a244a58d4078442