-
-
Save jakemac53/41b37117440beb4dc8e2 to your computer and use it in GitHub Desktop.
This file contains 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
library dart2jsbench; | |
import 'dart:js'; | |
import 'package:benchmark_harness/benchmark_harness.dart'; | |
class NewJsObjectBenchmark extends BenchmarkBase { | |
final JsFunction constructor; | |
final List args; | |
NewJsObjectBenchmark(this.constructor, String name, [this.args]) | |
: super('NewJsObjectBenchmark:$name'); | |
run() { | |
new JsObject(constructor, args); | |
} | |
} | |
main() { | |
new NewJsObjectBenchmark(context['MyObject'], 'NoArgs').report(); | |
new NewJsObjectBenchmark(context['MyObject'], 'Args', ['thing']).report(); | |
} |
This file contains 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
<html> | |
<head> | |
<script> | |
MyObject = function(arg) {}; | |
MyObject.prototype = {}; | |
</script> | |
<script type="application/dart" src="index.dart"> | |
</script> | |
<script src="packages/browser/dart.js"></script> | |
</head> | |
</html> |
This file contains 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
name: dart2js_bench | |
dependencies: | |
benchmark_harness: any |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment