Bug 176350 - [DFG] Optimize CompareGreaterEq(FinalObject, FinalObject)
Summary: [DFG] Optimize CompareGreaterEq(FinalObject, FinalObject)
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Yusuke Suzuki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-05 00:20 PDT by Yusuke Suzuki
Modified: 2017-09-05 01:15 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yusuke Suzuki 2017-09-05 00:20:11 PDT
Super funny thing is that Octane/box2d frequently executes this operation without setting valueOf / toString...
Comment 1 Yusuke Suzuki 2017-09-05 00:52:47 PDT
We need to consider how to optimize it. Preliminary experiment, just converting CompareGearterEq/CompareLessEq(FinalObject, FinalObject) => FinalObject Checks and JSConstant(true) improves box2d 8.9%. (Of course, it is not valid conversion. But box2d does not set valueOf / toString, so it does not change the result.)

box2d          x2      12.88978+-0.30108    ^    11.83268+-0.29723       ^ definitely 1.0893x faster
Comment 2 Yusuke Suzuki 2017-09-05 01:15:07 PDT
(In reply to Yusuke Suzuki from comment #1)
> We need to consider how to optimize it. Preliminary experiment, just
> converting CompareGearterEq/CompareLessEq(FinalObject, FinalObject) =>
> FinalObject Checks and JSConstant(true) improves box2d 8.9%. (Of course, it
> is not valid conversion. But box2d does not set valueOf / toString, so it
> does not change the result.)
> 
> box2d          x2      12.88978+-0.30108    ^    11.83268+-0.29723       ^
> definitely 1.0893x faster

In addition, we can find CompareLess(FinalObject, FinalObject). If we can convert it to false, we can achieve 13% improvement.

                            baseline                  patched                                      

box2d          x2      13.26226+-0.39901    ^    11.73540+-0.39178       ^ definitely 1.1301x faster