Skip to content

Instantly share code, notes, and snippets.

@ngryman
Created June 20, 2017 20:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ngryman/fd9bcd96910409f91af00d9fd4178a10 to your computer and use it in GitHub Desktop.
Save ngryman/fd9bcd96910409f91af00d9fd4178a10 to your computer and use it in GitHub Desktop.
Prevent type feedback leakage.
// Need to generate core of the benchmark dynamically to ensure
// that type feedback does not leak between individual sample runs.
var code = " /* " + (UID++) + " */ " + " for (var i = 0; i < N; i++) {" +
" var obj = arr[i];" +
" result += obj.x + obj.y + i;" +
"}" +
"return result";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment