| OLD | NEW |
| 1 #!/usr/bin/env dart | 1 #!/usr/bin/env dart |
| 2 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 2 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 3 // for details. All rights reserved. Use of this source code is governed by a | 3 // for details. All rights reserved. Use of this source code is governed by a |
| 4 // BSD-style license that can be found in the LICENSE file. | 4 // BSD-style license that can be found in the LICENSE file. |
| 5 | 5 |
| 6 #library("BenchmarkTests"); | 6 #library("BenchmarkTests"); |
| 7 #import("../../string_encoding/utf8.dart", prefix: "SE"); | 7 #import("../../../lib/utf/utf.dart", prefix: "SE"); |
| 8 #import("../../utf8/utf8.dart", prefix: "UT"); | |
| 9 #source("benchmark_runner.dart"); | 8 #source("benchmark_runner.dart"); |
| 10 | 9 |
| 11 void main() { | 10 void main() { |
| 12 | 11 |
| 13 final List<int> testEnglishUtf8 = const<int> [ | 12 final List<int> testEnglishUtf8 = const<int> [ |
| 14 0x54, 0x68, 0x65, 0x20, 0x71, 0x75, 0x69, 0x63, | 13 0x54, 0x68, 0x65, 0x20, 0x71, 0x75, 0x69, 0x63, |
| 15 0x6b, 0x20, 0x62, 0x72, 0x6f, 0x77, 0x6e, 0x20, | 14 0x6b, 0x20, 0x62, 0x72, 0x6f, 0x77, 0x6e, 0x20, |
| 16 0x66, 0x6f, 0x78, 0x20, 0x6a, 0x75, 0x6d, 0x70, | 15 0x66, 0x6f, 0x78, 0x20, 0x6a, 0x75, 0x6d, 0x70, |
| 17 0x73, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x74, | 16 0x73, 0x20, 0x6f, 0x76, 0x65, 0x72, 0x20, 0x74, |
| 18 0x68, 0x65, 0x20, 0x6c, 0x61, 0x7a, 0x79, 0x20, | 17 0x68, 0x65, 0x20, 0x6c, 0x61, 0x7a, 0x79, 0x20, |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 testConfig_1sec, () => | 113 testConfig_1sec, () => |
| 115 (new SE.Utf8Decoder(testRussianUtf8)).decodeRest()); | 114 (new SE.Utf8Decoder(testRussianUtf8)).decodeRest()); |
| 116 | 115 |
| 117 BenchmarkRunner.runTimed("SE_EL1","string_encoding/decodeUtf8-Greek", | 116 BenchmarkRunner.runTimed("SE_EL1","string_encoding/decodeUtf8-Greek", |
| 118 testConfig_1sec, () => | 117 testConfig_1sec, () => |
| 119 (new SE.Utf8Decoder(testGreekUtf8)).decodeRest()); | 118 (new SE.Utf8Decoder(testGreekUtf8)).decodeRest()); |
| 120 | 119 |
| 121 BenchmarkRunner.runTimed("SE_JA1","string_encoding/decodeUtf8-Katakana", | 120 BenchmarkRunner.runTimed("SE_JA1","string_encoding/decodeUtf8-Katakana", |
| 122 testConfig_1sec, () => | 121 testConfig_1sec, () => |
| 123 (new SE.Utf8Decoder(testKatakanaUtf8)).decodeRest()); | 122 (new SE.Utf8Decoder(testKatakanaUtf8)).decodeRest()); |
| 124 | |
| 125 BenchmarkRunner.runTimed("UT_EN1","Utf8Decoder/decodeUtf8-English1", | |
| 126 testConfig_1sec, () => | |
| 127 (new UT.Utf8Decoder(testEnglishUtf8, 0, testEnglishUtf8.length)) | |
| 128 .decodeRest()); | |
| 129 | |
| 130 BenchmarkRunner.runTimed("UT_DA1","Utf8Decoder/decodeUtf8-Danish1", | |
| 131 testConfig_1sec, () => | |
| 132 (new UT.Utf8Decoder(testDanishUtf8, 0, testDanishUtf8.length)) | |
| 133 .decodeRest()); | |
| 134 | |
| 135 BenchmarkRunner.runTimed("UT_HE1","Utf8Decoder/decodeUtf8-Hebrew1", | |
| 136 testConfig_1sec, () => | |
| 137 (new UT.Utf8Decoder(testHebrewUtf8, 0, testHebrewUtf8.length)) | |
| 138 .decodeRest()); | |
| 139 | |
| 140 BenchmarkRunner.runTimed("UT_RU1","Utf8Decoder/decodeUtf8-Russian1", | |
| 141 testConfig_1sec, | |
| 142 () => (new UT.Utf8Decoder(testRussianUtf8, 0, testRussianUtf8.length)) | |
| 143 .decodeRest()); | |
| 144 | |
| 145 BenchmarkRunner.runTimed("UT_EL1","Utf8Decoder/decodeUtf8-Greek", | |
| 146 testConfig_1sec, () => | |
| 147 (new UT.Utf8Decoder(testGreekUtf8, 0, testGreekUtf8.length)) | |
| 148 .decodeRest()); | |
| 149 | |
| 150 BenchmarkRunner.runTimed("UT_JA1","Utf8Decoder/decodeUtf8-Katakana", | |
| 151 testConfig_1sec,() => | |
| 152 (new UT.Utf8Decoder(testKatakanaUtf8, 0, testKatakanaUtf8.length)) | |
| 153 .decodeRest()); | |
| 154 } | 123 } |
| 155 | 124 |
| OLD | NEW |