You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add the <attr>\Testo\Bench</attr> attribute to a method, and Testo will show which implementation is faster. With statistics, outlier filtering, and stability recommendations.
313
+
314
+
</template>
315
+
316
+
<template #left>
317
+
318
+
```php
319
+
// Baseline method with the #[Bench] attribute
320
+
#[Bench(
321
+
callables: [
322
+
'sumInCycle' => [self::class, 'sumInCycle'],
323
+
],
324
+
arguments: [1, 5_000],
325
+
)]
326
+
public static function sumInArray(int $a, int $b): int
327
+
{
328
+
return \array_sum(\range($a, $b));
329
+
}
330
+
```
331
+
332
+
</template>
333
+
334
+
<template #right>
335
+
336
+
```php
337
+
// Alternative implementation
338
+
public static function sumInCycle(int $a, int $b): int
Добавьте атрибут <attr>\Testo\Bench</attr> к методу, и Testo покажет, какая из реализаций работает быстрее. Со статистикой, фильтрацией выбросов и рекомендациями по стабильности.
0 commit comments