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
<div id="result"></div> |
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
import 'dart:mirrors'; | |
class Proxy { | |
static final getName = currentMirrorSystem().getName; | |
final target; | |
Proxy(this.target); | |
noSuchMethod(invocation) { |
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
function Clash(x) { | |
// Each instance of Clash gets a different getter for the property | |
// xx. This for the second instance makes it impossible to have this | |
// accessor promoted to the hidden class because it does not match expected | |
// accessor (the same as the first instance had) which in turn prevents its | |
// inlining later. | |
Object.defineProperty(this, "xx", { | |
get: function () { return x * x } | |
}); | |
} |
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
function bar(x) { | |
try { // just to prevent inlining | |
return x; | |
} catch (e) { } | |
} | |
function foo(o) { | |
var sum = 0; | |
for (var i = 0; i < 10; i++) { | |
sum += bar(o.x); /* o.x will not be hoisted out of the loop */ |
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
--- FUNCTION SOURCE () id{0,0} --- | |
var iterations = 2; | |
print("Running (" + iterations + ")... "); | |
var testData = new Uint8Array(1024 * 1024); | |
for (var i = 0; i < 1024 * 1024; i++) { | |
testData[i] = i % 256; | |
} | |
var key = [0x80]; for (i = 1; i < 32; i++) key[i] = 0x07; | |
var nonce = []; for (i = 0; i < 8; i++) nonce[i] = 0x01; | |
if (iterations < 100) { |
This file has been truncated, but you can view the full file.
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
--- FUNCTION SOURCE () id{0,0} --- | |
var iterations = 2; | |
print("Running (" + iterations + ")... "); | |
var testData = new Uint8Array(1024 * 1024); | |
for (var i = 0; i < 1024 * 1024; i++) { | |
testData[i] = i % 256; | |
} | |
var key = [0x80]; for (i = 1; i < 32; i++) key[i] = 0x07; | |
var nonce = []; for (i = 0; i < 8; i++) nonce[i] = 0x01; | |
if (iterations < 100) { |
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
// ../jsshell-35.0/js y0.js | |
// TryCatch x 2,139,927 ops/sec ±0.96% (65 runs sampled) | |
// FastTry x 2,079,778 ops/sec ±1.07% (63 runs sampled) | |
// Fastest is TryCatch | |
load("lodash.js"); | |
load("benchmark.js"); | |
function fastTry (fn) { |
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
#define LIST(V) \ | |
V(A) \ | |
V(B) \ | |
V(C) | |
enum ListOfMyFavoriteEnglishLetters { | |
#define F(name) k##name, | |
LIST(F) | |
#undef F |
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
After Optimizations | |
==== file:///usr/local/google/home/vegorov/Downloads/benchmark_mirrors.dart_::_testWithoutMirrors | |
0: B0[graph]:2 { | |
v0 <- Constant(#null) T{Null?} | |
v1 <- Constant(#<optimized out>) | |
v2 <- Constant(#Context@0x7f6422ac3461 num_variables: 0) T{Context} | |
v3 <- Parameter(0) | |
v4 <- Constant(#TypeArguments: [Type: class 'int']) T{TypeArguments} | |
v5 <- Constant(#1) [1, 1] T{_Smi} | |
v12 <- Constant(#true) T{bool} |
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
local level = 2 | |
while true do | |
local info = debug.getinfo (level) | |
if not info then break end | |
p(string.format("-- #%d | [%s] function %s at %s:%d (defined at %d)", level, tostring(info.func), info.name or "?", info.source or "", info.currentline or -1, info.linedefined or -1)) | |
local localIdx = 1 | |
while true do | |
local name, value = debug.getlocal(level, localIdx) |