File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,8 +18,7 @@ class UtfStringBench
1818 * @Iterations(20)
1919 * @Revs(4)
2020 * @OutputTimeUnit("milliseconds")
21- * @Assert("mode(variant.time.avg) < 100 milliseconds +/- 10%")
22- * @Assert("mode(variant.time.avg) > 30 milliseconds +/- 10%")
21+ * @Assert("mode(variant.time.avg) < 40 milliseconds +/- 10%")
2322 */
2423 public function benchBuildUtfString (): void
2524 {
@@ -34,4 +33,25 @@ public function setUp(): void
3433 $ contentsPath = __DIR__ . '/../../LICENSE.txt ' ;
3534 $ this ->testContents = (string ) file_get_contents ($ contentsPath );
3635 }
36+
37+ /**
38+ * @Iterations(20)
39+ * @Revs(4)
40+ * @OutputTimeUnit("microseconds")
41+ * @Assert("mode(variant.time.avg) < 120 microseconds +/- 10%")
42+ */
43+ public function benchUtfStringRandomAccessWithUnicode (): void
44+ {
45+ $ text = 'abcdefghijklmnopqrstuvwxyz
46+ áéíóúýěřťǔǐǒǎšďȟǰǩľžčǚň
47+ 🦋😄😃😀😊😉😍😘😚😗😂👿😮😨😱😠😡😤😖😆😋👯
48+ P\xf8\xed\xb9ern\xec \xbelu\xbbou\xe8k\xfd k\xf3d \xfap\xecl \xef\xe1belsk\xe9 k\xf3dy
49+ xℤⅿↈⅬ⅀ↆℜℝ⅗ℾ℧ⅰℓⅯⅵⅣ⅒21⅞ ' ;
50+
51+ $ str1 = new UtfString ($ text );
52+ $ str1 ->offsetGet (10 );
53+ $ str1 ->offsetGet (100 );
54+ $ str1 ->offsetGet (20 );
55+ $ str1 ->offsetGet (0 );
56+ }
3757}
You can’t perform that action at this time.
0 commit comments