• gsathya's avatar
    Promises: Make debug calls only when debugging · 9eb320ad
    gsathya authored
    Previously, certain calls to DebugPushPromise and DebugPopPromise
    happened always, without any check to see if we were in a debugging
    environment. This patch adds a conditional check before making these
    debug calls to make sure they aren't called when not needed.
    
    Before the patch, running --prof over the bluebird benchmarks,
    brings up these unprotected debug calls --
    ticks    cpp   total   name
    16    6.7%    2.0%  v8::internal::Runtime_DebugPushPromise(int, v8::internal::Object**, v8::internal::Isolate*)
    7    2.9%    0.9%  v8::internal::Runtime_DebugPopPromise(int, v8::internal::Object**, v8::internal::Isolate*)
    
    This patch removes the above calls and provides a 4% improvement (with
    a 2% variance over 10 runs) in the bluebird benchmark.
    
    Review-Url: https://codereview.chromium.org/1985293002
    Cr-Commit-Position: refs/heads/master@{#36451}
    9eb320ad
promise.js 15.8 KB