Skip to content

Performance Comparison Between Builtin JavaScriptCore and {N}'s one

Martin Bektchiev edited this page Sep 10, 2018 · 5 revisions

Methodology

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`);

iOS 11.4.1 vs {N} version 4.2

Hardware:

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 700 - 860
100x Richards 320 - 380 350 - 380
100x Crypto.encrypt 350 - 400 375 - 400
100x code-load.runCodeLoadClosure 54 - 140 55 - 110

Measure different {N} runtime versions' performance

The TnsJsPerformanceBenchmarks app can be used for comparing the performance between different versions of {N}. Just follow the installation instructions and perform multiple runs with different runtime packages while keeping track of the outcomes.