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

Side by Side Diff: benchmark/benchmark.dart

Issue 1473563003: Cache the current working directory. (Closed) Base URL: git@github.com:dart-lang/path@master
Patch Set: Code review changes Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | lib/path.dart » ('j') | lib/path.dart » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import '../lib/path.dart' as path; 5 import '../lib/path.dart' as path;
6 6
7 void runBenchmark(String name, Function func, List files) { 7 void runBenchmark(String name, Function func, List files) {
8 // Warmup. 8 // Warmup.
9 for (int i = 0; i < 10000; i++) { 9 for (int i = 0; i < 10000; i++) {
10 for (var p in files) { 10 for (var p in files) {
(...skipping 29 matching lines...) Expand all
40 benchmark('extension', context.extension); 40 benchmark('extension', context.extension);
41 benchmark('rootPrefix', context.rootPrefix); 41 benchmark('rootPrefix', context.rootPrefix);
42 benchmark('isAbsolute', context.isAbsolute); 42 benchmark('isAbsolute', context.isAbsolute);
43 benchmark('isRelative', context.isRelative); 43 benchmark('isRelative', context.isRelative);
44 benchmark('isRootRelative', context.isRootRelative); 44 benchmark('isRootRelative', context.isRootRelative);
45 benchmark('normalize', context.normalize); 45 benchmark('normalize', context.normalize);
46 benchmark('relative', context.relative); 46 benchmark('relative', context.relative);
47 benchmark('toUri', context.toUri); 47 benchmark('toUri', context.toUri);
48 benchmark('prettyUri', context.prettyUri); 48 benchmark('prettyUri', context.prettyUri);
49 } 49 }
50
51 if (args.isEmpty || args.any((arg) => arg == 'current')) {
52 runBenchmark('current', (_) => path.current, [null]);
53 }
50 } 54 }
51 55
52 const COMMON_PATHS = const ['.', '..', 'out/ReleaseIA32/packages']; 56 const COMMON_PATHS = const ['.', '..', 'out/ReleaseIA32/packages'];
53 57
54 final STYLE_PATHS = { 58 final STYLE_PATHS = {
55 path.Style.posix: [ 59 path.Style.posix: [
56 '/home/user/dart/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart', 60 '/home/user/dart/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart',
57 ], 61 ],
58 path.Style.url: [ 62 path.Style.url: [
59 'https://example.server.org/443643002/path?top=yes#fragment', 63 'https://example.server.org/443643002/path?top=yes#fragment',
60 ], 64 ],
61 path.Style.windows: [ 65 path.Style.windows: [
62 r'C:\User\me\', 66 r'C:\User\me\',
63 r'\\server\share\my\folders\some\file.data', 67 r'\\server\share\my\folders\some\file.data',
64 ], 68 ],
65 }; 69 };
OLDNEW
« no previous file with comments | « no previous file | lib/path.dart » ('j') | lib/path.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698