-
-
Notifications
You must be signed in to change notification settings - Fork 59
Performance Comparison Between Builtin JavaScriptCore and {N}'s one
Martin Bektchiev edited this page Aug 15, 2018
·
5 revisions
Run algorithms taken from Octane in a {N} and ReactNative applications on a button press. Each algorithm is run a specified number of times and the time is tracked and logged. The button is pressed numerous times and the range of the logged values is given in the table below.
var algo = 'richards';
var f = require(`./${algo}`);
var start = new Date();
for (var i = 0; i < 100; ++i) {
f();
}
var end = new Date();
console.log(`"${algo} elapsed: ${((end.getTime() - start.getTime()))} ms`);
iPhoneXModules
iPhone X 64GB
Model MQAD2GH/A
S/N DNPVVDXQJCLJ
iOS v 11.4.1 (15G77)
Algorithm | {N} (ms) | RN (ms) | Remarks |
---|---|---|---|
100x DeltaBlue | 620 - 840 | 630 - 760 | |
100x Richards | 320 - 380 | 350 - 380 | |
100x Crypto.encrypt | 350 - 400 | 375 - 400 | |
100x code-load.runCodeLoadClosure | 54 - 140 | 55 - 90 |
React Native's console.log
was not visible and that's why I threw an unhandled JS exception with the message. As a result each button press in the RN app is after a restart, while with {N} I managed to press the button numerous times in one run. Still I performed many restarts of the {N} app as well. The difference in the lowest numbers in favor of {N} is due to being able to press the button continuously