This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VMs tested: | |
"before" at /Users/Developer/Projects/Webkit2/WebKitBuild/before_patch/Release/jsc | |
"after" at /Users/Developer/Projects/Webkit2/WebKitBuild/es6_functions/Release/jsc | |
Collected 4 samples per benchmark/VM, with 4 VM invocations per benchmark. Ran 2 benchmark | |
iterations, and measured the total time of those iterations, for each sample. Emitted a call to | |
gc() between sample measurements. Used 4 benchmark iterations per VM invocation for warm-up. Used | |
the jsc-specific preciseTime() function to get microsecond-level timing. Reporting benchmark | |
execution times with 95% confidence intervals in milliseconds. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MacBook-Pro-Skachkov-2:Webkit2 Developer$ Tools/Scripts/run-jsc-benchmarks before:/Users/Developer/Projects/Webkit2/WebKitBuild/before_patch/Release/jsc after:/Users/Developer/Projects/Webkit2/WebKitBuild/es6_functions/Release/jsc --octane --benchmark="jquery|closure" --outer 10 | |
VMs tested: | |
"before" at /Users/Developer/Projects/Webkit2/WebKitBuild/before_patch/Release/jsc | |
"after" at /Users/Developer/Projects/Webkit2/WebKitBuild/es6_functions/Release/jsc | |
Collected 10 samples per benchmark/VM, with 10 VM invocations per benchmark. Emitted a call to | |
gc() between sample measurements. Used 1 benchmark iteration per VM invocation for warm-up. Used | |
the jsc-specific preciseTime() function to get microsecond-level timing. Reporting benchmark | |
execution times with 95% confidence intervals in milliseconds. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1 | |
VMs tested: | |
"before" at /Users/Developer/Projects/Webkit2/WebKitBuild/before_patch/Release/jsc | |
"after" at /Users/Developer/Projects/Webkit2/WebKitBuild/es6_functions/Release/jsc | |
Collected 10 samples per benchmark/VM, with 10 VM invocations per benchmark. Emitted a call to | |
gc() between sample measurements. Used 1 benchmark iteration per VM invocation for warm-up. Used | |
the jsc-specific preciseTime() function to get microsecond-level timing. Reporting benchmark | |
execution times with 95% confidence intervals in milliseconds. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
VMs tested: | |
"without_poc" at /Users/Developer/Projects/Webkit2/WebKitBuild/without_poc/Release/jsc | |
"poc_af" at /Users/Developer/Projects/Webkit2/WebKitBuild/poc_af/Release/jsc | |
Collected 4 samples per benchmark/VM, with 4 VM invocations per benchmark. Ran 10 benchmark | |
iterations, and measured the total time of those iterations, for each sample. Emitted a call to | |
gc() between sample measurements. Used 50 benchmark iterations per VM invocation for warm-up. Used | |
the jsc-specific preciseTime() function to get microsecond-level timing. Reporting benchmark | |
execution times with 95% confidence intervals in milliseconds. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var promise = new Promise(function(resolve, reject) { … } ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Create promise | |
var promise = new Promise(function (resolve) { | |
//Resolve promise in 50ms with string 'success' | |
setTimeout(function () { resolve('success'); }, 50); | |
}); | |
// Handle successful resolve of promise | |
promise.then(function (result) { | |
console.log(result); // Print: success | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bar = new Promise(function (resolve) { | |
setTimeout(function () { reject('error'); }, 50); | |
}); | |
bar.then(function() {}, function (reject) { | |
console.log('reject:', reject); | |
}); // reject:error | |
bar.catch(function (reject) { | |
console.log('catch:', reject); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getPromise = (value, delay) => { | |
return new Promise(resolve => { | |
setTimeout(() => resolve(value), delay); | |
}); | |
}; | |
var promise = getPromise('start value', 150); | |
promise | |
.then(result => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var promiseImmediate = Promise.resolve('Immediate value'); | |
promiseImmediate.then(result => console.log('promiseImmediate:', result)); | |
// 'promiseImmediate: Immediate value' will visible imidiatly | |
var resolver = {}; | |
var promise = new Promise(resolve => { resolver.resolve = resolve; }); | |
var promiseDefferred = Promise.resolve(promise); | |
promiseDefferred.then(result => console.log('promiseDefferred:', result)); | |
// No any text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var promiseImmediate = Promise.reject('Immediate value'); | |
promiseImmediate.then( | |
result => console.log('promiseImmediate success:', result), | |
error => console.log('promiseImmediate fail:', error) | |
); // promiseImmediate fail: Immediate value | |
promiseImmediate.catch(error => console.log('promiseImmediate catch:', error)); | |
var resolver = {}; | |
var promise = new Promise((resolve, reject) => { resolver.reject = reject; }); |