mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Address comments Add a basic parser benchmark This CL adds a basic benchmark for the parser. There isn't a direct way to exercise the parser in Sky, so we use imports. This CL also adds a load event to <import> to determine when the import is done loading. R=eseidel@chromium.org parser benchmark wip
23 lines
499 B
Plaintext
23 lines
499 B
Plaintext
<import src="../resources/runner.sky" as="PerfRunner" />
|
|
<script>
|
|
var specURL = "resources/html5.html";
|
|
var cacheBust = 100;
|
|
|
|
var runner = new PerfRunner({
|
|
iterations: 10,
|
|
unit: 'ms',
|
|
});
|
|
|
|
runner.runAsync(function(done) {
|
|
var element = document.createElement("import");
|
|
|
|
element.addEventListener("load", function() {
|
|
element.remove();
|
|
done();
|
|
});
|
|
|
|
element.setAttribute("src", specURL + "?cacheBust=" + cacheBust++);
|
|
document.documentElement.appendChild(element);
|
|
});
|
|
</script>
|