Index: packages/polymer_expressions/benchmark/parse.dart |
diff --git a/packages/polymer_expressions/benchmark/parse.dart b/packages/polymer_expressions/benchmark/parse.dart |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b131509f0955f22d0bdebde73868a45145c70df6 |
--- /dev/null |
+++ b/packages/polymer_expressions/benchmark/parse.dart |
@@ -0,0 +1,28 @@ |
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
+// for details. All rights reserved. Use of this source code is governed by a |
+// BSD-style license that can be found in the LICENSE file. |
+ |
+library polymer_expressions.benchmark.parse; |
+ |
+import 'package:benchmark_harness/benchmark_harness.dart'; |
+import 'package:polymer_expressions/parser.dart' show parse; |
+ |
+/** |
+ * Measures pure parsing time of several expressions |
+ */ |
+class PolymerParseBenchmark extends BenchmarkBase { |
+ PolymerParseBenchmark() : super('PolymerParseBenchmark'); |
+ |
+ run() { |
+ parse('foo.bar.baz'); |
+ parse('f()'); |
+ parse('(1 + 2) * 3'); |
+ parse('1 + 2.0 + false + "abcdefg" + {"a": 1}'); |
+ parse('(a * (b * (c * (d * (e)))))'); |
+ parse('a(b(c(d(e(f)))))'); |
+ } |
+} |
+ |
+main() { |
+ new PolymerParseBenchmark().report(); |
+} |