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

Unified Diff: third_party/pkg/angular/perf/try_catch_perf.dart

Issue 256553002: Revert "Update all Angular libs (run update_all.sh)." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 8 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
« no previous file with comments | « third_party/pkg/angular/perf/scope_perf.dart ('k') | third_party/pkg/angular/perf/watch_group_perf.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/pkg/angular/perf/try_catch_perf.dart
diff --git a/third_party/pkg/angular/perf/try_catch_perf.dart b/third_party/pkg/angular/perf/try_catch_perf.dart
new file mode 100644
index 0000000000000000000000000000000000000000..9112159b79fa766f003a696156610d7e2dcf1e2d
--- /dev/null
+++ b/third_party/pkg/angular/perf/try_catch_perf.dart
@@ -0,0 +1,26 @@
+library angular.perf.try_catch;
+
+import '_perf.dart';
+
+/**
+ * Compare with JS: http://jsperf.com/throw-new-error-vs-throw-name-error
+ *
+ * JavaScript vs Dart times on same machine:
+ *
+ * JavaScript Dart
+ * try-catch no stack: 4,952,173 3,944,303 ops/sec
+ * try-catch with stack: 111,815 840,843 ops/sec
+ * try-catch read stack: 9,206 9,356 ops/sec
+ */
+main() {
+ var obj = {};
+ time('try-catch no stack', () {
+ try { throw obj; } catch(e) { return e; }
+ } );
+ time('try-catch with stack', () {
+ try { throw obj; } catch(e, s) { return s; }
+ } );
+ time('try-catch read stack', () {
+ try { throw obj; } catch(e, s) { return '$s'; }
+ } );
+}
« no previous file with comments | « third_party/pkg/angular/perf/scope_perf.dart ('k') | third_party/pkg/angular/perf/watch_group_perf.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698