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

Unified Diff: pkg/path/benchmark/benchmark.dart

Issue 812253002: Delete a bunch of packages that are now on GitHub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Un-delete http Created 6 years 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 | « pkg/path/README.md ('k') | pkg/path/lib/path.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/path/benchmark/benchmark.dart
diff --git a/pkg/path/benchmark/benchmark.dart b/pkg/path/benchmark/benchmark.dart
deleted file mode 100644
index 60a2b5318adcf36c500004133fafb208bd471c5f..0000000000000000000000000000000000000000
--- a/pkg/path/benchmark/benchmark.dart
+++ /dev/null
@@ -1,68 +0,0 @@
-// Copyright (c) 2014, 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.
-
-import '../lib/path.dart' as path;
-
-void runBenchmark(String name, Function func, List files) {
- // Warmup.
- for (int i = 0; i < 10000; i++) {
- for (var p in files) {
- func(p);
- }
- }
- var count = 100000;
- var sw = new Stopwatch()..start();
- for (int i = 0; i < count; i++) {
- for (var p in files) {
- func(p);
- }
- }
- print("$name: ${count / sw.elapsedMicroseconds} iter/us (${sw.elapsed})");
-}
-
-main(args) {
- for (var style in [path.Style.posix, path.Style.url, path.Style.windows]) {
- var context = new path.Context(style: style);
- var files = COMMON_PATHS.toList()..addAll(STYLE_PATHS[style]);
-
- void benchmark(name, func) {
- name = style.name + '-' + name;
- if (args.isEmpty || args.any((arg) => name.contains(arg))) {
- runBenchmark(name, func, files);
- }
- }
-
- benchmark('basename', context.basename);
- benchmark('basenameWithoutExtension', context.basenameWithoutExtension);
- benchmark('dirname', context.dirname);
- benchmark('extension', context.extension);
- benchmark('rootPrefix', context.rootPrefix);
- benchmark('isAbsolute', context.isAbsolute);
- benchmark('isRelative', context.isRelative);
- benchmark('isRootRelative', context.isRootRelative);
- benchmark('normalize', context.normalize);
- benchmark('relative', context.relative);
- benchmark('toUri', context.toUri);
- benchmark('prettyUri', context.prettyUri);
- }
-}
-
-const COMMON_PATHS = const [
- '.',
- '..',
- 'out/ReleaseIA32/packages',
-];
-
-final STYLE_PATHS = {
- path.Style.posix: [
- '/home/user/dart/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart',
- ],
- path.Style.url: [
- 'https://example.server.org/443643002/path?top=yes#fragment',
- ],
- path.Style.windows: [
- r'C:\User\me\',
- r'\\server\share\my\folders\some\file.data',
- ],
-};
« no previous file with comments | « pkg/path/README.md ('k') | pkg/path/lib/path.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698