Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(552)

Unified Diff: samples/third_party/dromaeo/tests/dom-attr-htmlfast.dart

Issue 9732019: dart:html perf optimization based on runing Dromaeo benchmarks (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Ready for review Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: samples/third_party/dromaeo/tests/dom-attr-htmlfast.dart
diff --git a/samples/third_party/dromaeo/tests/dom-attr-htmlfast.dart b/samples/third_party/dromaeo/tests/dom-attr-htmlfast.dart
new file mode 100644
index 0000000000000000000000000000000000000000..653a84d07aa8d5a0baa7b62bd025518a8cb34d4c
--- /dev/null
+++ b/samples/third_party/dromaeo/tests/dom-attr-htmlfast.dart
@@ -0,0 +1,32 @@
+#library("dom_attr");
+#import("dart:html");
+#import('runner.dart');
+
+void main() {
+ final int num = 10240;
+
+ // Try to force real results.
+ var ret;
+
+ Element elem = document.query('#test1');
+ Element a = document.query('a');
+
+ new Suite(window, 'dom-attr')
+ .test('getAttribute', () {
+ for (int i = 0; i < num; i++)
+ ret = elem.$dom_getAttribute('id');
+ })
+ .test('element.property', () {
+ for (int i = 0; i < num * 2; i++)
+ ret = elem.id;
+ })
+ .test('setAttribute', () {
+ for (int i = 0; i < num; i++)
+ a.$dom_setAttribute('id', 'foo');
+ })
+ .test('element.property = value', () {
+ for (int i = 0; i < num; i++)
+ a.id = 'foo';
+ })
+ .end();
+}

Powered by Google App Engine
This is Rietveld 408576698