OLD | NEW |
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 28 matching lines...) Expand all Loading... |
39 benchmark('dirname', context.dirname); | 39 benchmark('dirname', context.dirname); |
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 benchmark('isWithin', context.isWithin); |
49 } | 50 } |
50 } | 51 } |
51 | 52 |
52 const COMMON_PATHS = const ['.', '..', 'out/ReleaseIA32/packages']; | 53 const COMMON_PATHS = const ['.', '..', 'out/ReleaseIA32/packages']; |
53 | 54 |
54 final STYLE_PATHS = { | 55 final STYLE_PATHS = { |
55 path.Style.posix: [ | 56 path.Style.posix: [ |
56 '/home/user/dart/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart', | 57 '/home/user/dart/sdk/lib/indexed_db/dart2js/indexed_db_dart2js.dart', |
57 ], | 58 ], |
58 path.Style.url: [ | 59 path.Style.url: [ |
59 'https://example.server.org/443643002/path?top=yes#fragment', | 60 'https://example.server.org/443643002/path?top=yes#fragment', |
60 ], | 61 ], |
61 path.Style.windows: [ | 62 path.Style.windows: [ |
62 r'C:\User\me\', | 63 r'C:\User\me\', |
63 r'\\server\share\my\folders\some\file.data', | 64 r'\\server\share\my\folders\some\file.data', |
64 ], | 65 ], |
65 }; | 66 }; |
OLD | NEW |