Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion tally.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@
// The slowest benchmark takes a few seconds natively and about 13 minutes under the simulation.
// One stuck in a loop fails in the native run, one that regresses far beyond that fails as not
// measured instead of holding up its shard.
->withTimeLimits(30, 25 * 60);
->withTimeLimits(30, 25 * 60)
// tally accept writes #[ExpectedFor(dataSet: '…')] like the benchmarks do
->withNamedArguments(true);
6 changes: 3 additions & 3 deletions tests/bench/AcceptsResultBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,15 @@ public function boot(int $results): void
}

#[DataProvider(method: 'results')]
#[ExpectedFor(dataSet: 'results-16', instructions: '16.91K', cycles: '70.34K', memory: '1.180KiB')]
#[ExpectedFor(dataSet: 'results-16', instructions: '16.91K', cycles: '53.31K', memory: '1.180KiB')]
#[ExpectedFor(dataSet: 'results-256', instructions: '212.4K', cycles: '362.0K', memory: '24.24KiB')]
public function benchMaxMin(int $results): AcceptsResult
{
return AcceptsResult::maxMin(...$this->results);
}

#[DataProvider(method: 'results')]
#[ExpectedFor(dataSet: 'results-16', instructions: '18.73K', cycles: '80.59K', memory: '1.547KiB')]
#[ExpectedFor(dataSet: 'results-16', instructions: '18.73K', cycles: '61.35K', memory: '1.547KiB')]
#[ExpectedFor(dataSet: 'results-256', instructions: '227.3K', cycles: '392.4K', memory: '32.30KiB')]
public function benchExtremeIdentity(int $results): AcceptsResult
{
Expand All @@ -71,7 +71,7 @@ public function benchExtremeIdentity(int $results): AcceptsResult
* StringType::accepts() accepts each constant string of the union.
*/
#[DataProvider(method: 'results')]
#[ExpectedFor(dataSet: 'results-16', instructions: '43.10K', cycles: '136.6K', memory: '1.547KiB')]
#[ExpectedFor(dataSet: 'results-16', instructions: '43.10K', cycles: '113.9K', memory: '1.547KiB')]
#[ExpectedFor(dataSet: 'results-256', instructions: '557.0K', cycles: '736.1K', memory: '32.30KiB')]
public function benchStringAcceptsUnion(int $results): AcceptsResult
{
Expand Down
4 changes: 2 additions & 2 deletions tests/bench/ArgumentsNormalizerBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public function boot(bool $named): void
* A call without named arguments is returned as it is, a call with them is rebuilt in the order of the parameters.
*/
#[DataProvider(method: 'calls')]
#[ExpectedFor(dataSet: 'named', instructions: '24.70K', cycles: '121.3K', memory: '2.516KiB')]
#[ExpectedFor(dataSet: 'positional', instructions: '2.670K', cycles: '27.86K', memory: '0B')]
#[ExpectedFor(dataSet: 'named', instructions: '24.75K', cycles: '99.67K', memory: '2.516KiB')]
#[ExpectedFor(dataSet: 'positional', instructions: '2.670K', cycles: '21.83K', memory: '0B')]
public function benchReorderFuncArguments(bool $named): ?FuncCall
{
if ($this->acceptor === null || $this->call === null) {
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/BetterReflectionProviderBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function boot(): void
/**
* Every scope that enters an anonymous class asks for its reflection again.
*/
#[Expected(instructions: '10.83K', cycles: '92.06K', memory: '256B')]
#[Expected(instructions: '10.83K', cycles: '78.18K', memory: '256B')]
public function benchGetAnonymousClassReflectionAgain(): ClassReflection
{
if ($this->reflectionProvider === null || $this->class === null || $this->scope === null) {
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/BetterReflectionSourceLocatorFactoryBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function boot(): void
/**
* Every process creates the source locator when it boots, also one that never locates a class.
*/
#[Expected(instructions: '2.283K', cycles: '29.67K', memory: '1.328KiB')]
#[Expected(instructions: '2.283K', cycles: '16.32K', memory: '1.328KiB')]
public function benchCreate(): SourceLocator
{
if ($this->factory === null) {
Expand Down
6 changes: 3 additions & 3 deletions tests/bench/ClassReflectionBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,13 @@ public function doubled(array $values): array
/**
* Asking again for a method answers from the cache filled by the first call.
*/
#[Expected(instructions: '2.194K', cycles: '28.37K', memory: '40B')]
#[Expected(instructions: '2.194K', cycles: '17.03K', memory: '40B')]
public function benchGetMethodAgain(): ExtendedMethodReflection
{
return $this->class()->getMethod('doubled', new OutOfClassScope());
}

#[Expected(instructions: '2.515K', cycles: '32.66K', memory: '40B')]
#[Expected(instructions: '2.515K', cycles: '21.25K', memory: '40B')]
public function benchGetPropertyAgain(): ExtendedPropertyReflection
{
// @phpstan-ignore method.deprecated (the method the cache early return is in)
Expand All @@ -87,7 +87,7 @@ public function benchGetPropertyAgain(): ExtendedPropertyReflection
/**
* The hottest call on the class, memoized since 2.2.14.
*/
#[Expected(instructions: '1.016K', cycles: '13.78K', memory: '0B')]
#[Expected(instructions: '1.016K', cycles: '8.566K', memory: '0B')]
public function benchGetName(): string
{
return $this->class()->getName();
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/CollectorsRegistryBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function boot(): void
*
* @return mixed[]
*/
#[Expected(instructions: '3.452K', cycles: '28.42K', memory: '376B')]
#[Expected(instructions: '3.452K', cycles: '21.94K', memory: '376B')]
public function benchGetCollectors(): array
{
if ($this->registry === null) {
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/ComposerHelperBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function boot(): void
*
* @return array<string, mixed>|null
*/
#[Expected(instructions: '1.174K', cycles: '15.80K', memory: '0B')]
#[Expected(instructions: '1.174K', cycles: '13.64K', memory: '0B')]
public function benchGetComposerConfigAgain(): ?array
{
return ComposerHelper::getComposerConfig($this->root);
Expand Down
10 changes: 5 additions & 5 deletions tests/bench/ConstantArrayTypeBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ public function benchIsSuperTypeOf(int $keys): bool
* only described when it is reported.
*/
#[DataProvider(method: 'keys')]
#[ExpectedFor(dataSet: 'keys-16', instructions: '49.30K', cycles: '158.1K', memory: '1.797KiB')]
#[ExpectedFor(dataSet: 'keys-64', instructions: '164.7K', cycles: '300.6K', memory: '4.070KiB')]
#[ExpectedFor(dataSet: 'keys-16', instructions: '49.30K', cycles: '133.3K', memory: '1.797KiB')]
#[ExpectedFor(dataSet: 'keys-64', instructions: '164.7K', cycles: '275.5K', memory: '4.070KiB')]
#[ExpectedFor(dataSet: 'keys-256', instructions: '625.6K', cycles: '871.5K', memory: '20.32KiB')]
public function benchIsSuperTypeOfSealedWithoutKey(int $keys): bool
{
Expand All @@ -132,9 +132,9 @@ public function benchIsSuperTypeOfSealedWithoutKey(int $keys): bool
* The verbosity of the reason is only chosen when an offset does not accept.
*/
#[DataProvider(method: 'keys')]
#[ExpectedFor(dataSet: 'keys-16', instructions: '1.921M', cycles: '3.173M', memory: '157.0KiB')]
#[ExpectedFor(dataSet: 'keys-64', instructions: '3.080M', cycles: '4.728M', memory: '157.0KiB')]
#[ExpectedFor(dataSet: 'keys-256', instructions: '7.715M', cycles: '10.97M', memory: '160.8KiB')]
#[ExpectedFor(dataSet: 'keys-16', instructions: '1.920M', cycles: '3.154M', memory: '92.96KiB')]
#[ExpectedFor(dataSet: 'keys-64', instructions: '3.079M', cycles: '4.727M', memory: '92.96KiB')]
#[ExpectedFor(dataSet: 'keys-256', instructions: '7.715M', cycles: '11.04M', memory: '96.77KiB')]
public function benchAcceptsSameShape(int $keys): bool
{
if ($this->sameShape === null) {
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/ConstantArrayTypePhp74Bench.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function boot(): void
/**
* [$dateTime, 'format'] and the other methods of DateTime, called on an object.
*/
#[Expected(instructions: '169.9K', cycles: '324.2K', memory: '1.164KiB')]
#[Expected(instructions: '170.0K', cycles: '302.5K', memory: '1.164KiB')]
public function benchFindTypeAndMethodNames(): int
{
$found = 0;
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/ConstantStringTypeBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function benchToArrayKey(): array
* 'DateTime::format' and other methods of DateTime, static or not. Since PHP 8 such a string
* may name an instance method, so the method is not looked into.
*/
#[Expected(instructions: '86.86K', cycles: '225.3K', memory: '952B')]
#[Expected(instructions: '86.85K', cycles: '204.5K', memory: '952B')]
public function benchIsCallable(): TrinaryLogic
{
$result = TrinaryLogic::createYes();
Expand Down
6 changes: 3 additions & 3 deletions tests/bench/DependencyResolverBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ public function boot(string $case): void
* The files and packages a reference to a class from an analysed file depends on.
*/
#[DataProvider(method: 'references')]
#[ExpectedFor(dataSet: 'analysed', instructions: '75.18K', cycles: '221.1K', memory: '4.234KiB')]
#[ExpectedFor(dataSet: 'not-analysed', instructions: '84.77K', cycles: '226.1K', memory: '4.234KiB')]
#[ExpectedFor(dataSet: 'own-file', instructions: '73.58K', cycles: '217.5K', memory: '4.234KiB')]
#[ExpectedFor(dataSet: 'analysed', instructions: '75.18K', cycles: '198.4K', memory: '4.234KiB')]
#[ExpectedFor(dataSet: 'not-analysed', instructions: '84.75K', cycles: '203.9K', memory: '4.234KiB')]
#[ExpectedFor(dataSet: 'own-file', instructions: '73.59K', cycles: '195.1K', memory: '4.234KiB')]
public function benchResolveClassReference(string $case): ResolvedDependencies
{
if ($this->resolver === null || $this->dependencies === null) {
Expand Down
4 changes: 2 additions & 2 deletions tests/bench/ExpressionTypeHolderBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function boot(): void
/**
* The same holder (#4777).
*/
#[Expected(instructions: '1.101K', cycles: '14.52K', memory: '0B')]
#[Expected(instructions: '1.101K', cycles: '8.661K', memory: '0B')]
public function benchEqualsSameHolder(): bool
{
$holder = $this->holder();
Expand All @@ -58,7 +58,7 @@ public function benchEqualsSameHolder(): bool
/**
* Another holder of the same type object (#4800).
*/
#[Expected(instructions: '2.659K', cycles: '28.84K', memory: '0B')]
#[Expected(instructions: '2.659K', cycles: '23.00K', memory: '0B')]
public function benchAndSameType(): ExpressionTypeHolder
{
if ($this->sameType === null) {
Expand Down
4 changes: 2 additions & 2 deletions tests/bench/FileCacheStorageBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public function boot(int $entries): void
* @throws DirectoryCreatorException
*/
#[DataProvider(method: 'entries')]
#[ExpectedFor(dataSet: 'entries-100', instructions: '246.7K', cycles: '601.2K', memory: '17.29KiB')]
#[ExpectedFor(dataSet: 'entries-10000', instructions: '19.12M', cycles: '32.34M', memory: '1.345MiB')]
#[ExpectedFor(dataSet: 'entries-100', instructions: '234.2K', cycles: '550.6K', memory: '17.29KiB')]
#[ExpectedFor(dataSet: 'entries-10000', instructions: '19.15M', cycles: '32.40M', memory: '1.345MiB')]
public function benchSave(int $entries): void
{
if ($this->storage === null) {
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/FileCacheStorageMissBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function boot(): void
* The reflection cache in front of the PHP-internal locator is asked for every class name the
* locators before it do not find, and most were never written.
*/
#[Expected(instructions: '7.924K', cycles: '57.79K', memory: '824B')]
#[Expected(instructions: '7.912K', cycles: '48.44K', memory: '824B')]
public function benchLoadMissing(): mixed
{
if ($this->storage === null) {
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/GenericObjectTypeCheckBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function boot(int $keys): void
* @return list<mixed>
*/
#[DataProvider(method: 'keys')]
#[ExpectedFor(dataSet: 'keys-16', instructions: '46.09K', cycles: '104.2K', memory: '0B')]
#[ExpectedFor(dataSet: 'keys-16', instructions: '46.09K', cycles: '97.47K', memory: '0B')]
#[ExpectedFor(dataSet: 'keys-64', instructions: '174.5K', cycles: '291.4K', memory: '0B')]
public function benchCheckTypeWithoutClasses(int $keys): array
{
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/GenericParametersAcceptorResolverBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function boot(int $parameters): void
* resolved into an extended one with all of its parameters copied.
*/
#[DataProvider(method: 'parameters')]
#[ExpectedFor(dataSet: 'parameters-2', instructions: '91.12K', cycles: '342.5K', memory: '4.328KiB')]
#[ExpectedFor(dataSet: 'parameters-2', instructions: '91.12K', cycles: '317.5K', memory: '4.328KiB')]
#[ExpectedFor(dataSet: 'parameters-16', instructions: '1.002M', cycles: '1.510M', memory: '10.73KiB')]
public function benchResolve(int $parameters): ParametersAcceptor
{
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/HashFunctionsReturnTypeExtensionBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ final class HashFunctionsReturnTypeExtensionBench
* The container creates the extension for every analysis, also of code that calls no hash function.
* Since 2.3.0 its constructor takes no PHP version, PHP ignores the argument there.
*/
#[Expected(instructions: '1.640K', cycles: '19.02K', memory: '136B')]
#[Expected(instructions: '1.640K', cycles: '2.210K', memory: '136B')]
public function benchCreate(): HashFunctionsReturnTypeExtension
{
// @phpstan-ignore new.noConstructor (2.2.13 to 2.2.17 take the PHP version)
Expand Down
6 changes: 3 additions & 3 deletions tests/bench/InitializerExprTypeResolverBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ public function boot(int $items): void
* A ternary with both branches, `[...] ? 1 : 2`, does not need the type of its condition.
*/
#[DataProvider(method: 'items')]
#[ExpectedFor(dataSet: 'items-8', instructions: '57.59K', cycles: '258.3K', memory: '2.516KiB')]
#[ExpectedFor(dataSet: 'items-128', instructions: '57.59K', cycles: '259.2K', memory: '2.516KiB')]
#[ExpectedFor(dataSet: 'items-8', instructions: '57.59K', cycles: '235.1K', memory: '2.516KiB')]
#[ExpectedFor(dataSet: 'items-128', instructions: '57.59K', cycles: '236.1K', memory: '2.516KiB')]
public function benchTernary(int $items): Type
{
if ($this->ternary === null) {
Expand All @@ -68,7 +68,7 @@ public function benchTernary(int $items): Type
* `[...['k0' => 0, 'k1' => 1, ...]]`, whose string keys are kept since PHP 8.1
*/
#[DataProvider(method: 'items')]
#[ExpectedFor(dataSet: 'items-8', instructions: '234.4K', cycles: '467.9K', memory: '10.89KiB')]
#[ExpectedFor(dataSet: 'items-8', instructions: '234.4K', cycles: '443.2K', memory: '10.89KiB')]
#[ExpectedFor(dataSet: 'items-128', instructions: '11.05M', cycles: '12.69M', memory: '143.9KiB')]
public function benchUnpackStringKeys(int $items): Type
{
Expand Down
6 changes: 3 additions & 3 deletions tests/bench/IntersectionTypeBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,15 @@ public function benchAskAgainWhatItIs(int $members): TrinaryLogic
* stdClass, the first member, is already a subtype of stdClass.
*/
#[DataProvider(method: 'members')]
#[ExpectedFor(dataSet: 'members-16', instructions: '10.59K', cycles: '94.13K', memory: '1.188KiB')]
#[ExpectedFor(dataSet: 'members-64', instructions: '10.59K', cycles: '94.13K', memory: '1.188KiB')]
#[ExpectedFor(dataSet: 'members-16', instructions: '10.59K', cycles: '71.32K', memory: '1.188KiB')]
#[ExpectedFor(dataSet: 'members-64', instructions: '10.59K', cycles: '71.36K', memory: '1.188KiB')]
public function benchIsSubTypeOf(int $members): IsSuperTypeOfResult
{
return $this->subject()->isSubTypeOf(new ObjectType(stdClass::class));
}

#[DataProvider(method: 'members')]
#[ExpectedFor(dataSet: 'members-16', instructions: '230.8K', cycles: '467.4K', memory: '5.898KiB')]
#[ExpectedFor(dataSet: 'members-16', instructions: '230.8K', cycles: '441.1K', memory: '5.898KiB')]
#[ExpectedFor(dataSet: 'members-64', instructions: '1.378M', cycles: '1.659M', memory: '11.98KiB')]
public function benchIsAcceptedBy(int $members): AcceptsResult
{
Expand Down
6 changes: 3 additions & 3 deletions tests/bench/IsSuperTypeOfResultBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,15 @@ public function boot(int $results): void
}

#[DataProvider(method: 'results')]
#[ExpectedFor(dataSet: 'results-16', instructions: '17.77K', cycles: '64.88K', memory: '1.102KiB')]
#[ExpectedFor(dataSet: 'results-16', instructions: '17.77K', cycles: '54.47K', memory: '1.102KiB')]
#[ExpectedFor(dataSet: 'results-256', instructions: '234.9K', cycles: '392.2K', memory: '24.16KiB')]
public function benchMaxMin(int $results): IsSuperTypeOfResult
{
return IsSuperTypeOfResult::maxMin(...$this->results);
}

#[DataProvider(method: 'results')]
#[ExpectedFor(dataSet: 'results-16', instructions: '19.58K', cycles: '75.07K', memory: '1.469KiB')]
#[ExpectedFor(dataSet: 'results-16', instructions: '19.58K', cycles: '61.75K', memory: '1.469KiB')]
#[ExpectedFor(dataSet: 'results-256', instructions: '249.9K', cycles: '422.3K', memory: '32.22KiB')]
public function benchExtremeIdentity(int $results): IsSuperTypeOfResult
{
Expand All @@ -83,7 +83,7 @@ public function benchExtremeIdentity(int $results): IsSuperTypeOfResult
* StringType::isSuperTypeOf() is asked about each constant string of the union.
*/
#[DataProvider(method: 'results')]
#[ExpectedFor(dataSet: 'results-16', instructions: '41.64K', cycles: '128.5K', memory: '1.469KiB')]
#[ExpectedFor(dataSet: 'results-16', instructions: '41.64K', cycles: '108.7K', memory: '1.469KiB')]
#[ExpectedFor(dataSet: 'results-256', instructions: '548.1K', cycles: '720.9K', memory: '32.22KiB')]
public function benchStringIsSuperTypeOfUnion(int $results): IsSuperTypeOfResult
{
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/LoaderFactoryBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function boot(): void
*
* @return mixed[]
*/
#[Expected(instructions: '549.6K', cycles: '1.044M', memory: '41.72KiB')]
#[Expected(instructions: '531.6K', cycles: '1.005M', memory: '37.03KiB')]
public function benchLoadConfigAgain(): array
{
if ($this->loaderFactory === null) {
Expand Down
6 changes: 3 additions & 3 deletions tests/bench/MemoizingReflectionProviderBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class Member {}
$this->reflectionProvider->getClass('MemoizingReflectionProviderBench\Member');
}

#[Expected(instructions: '2.166K', cycles: '26.71K', memory: '64B')]
#[Expected(instructions: '2.166K', cycles: '19.09K', memory: '64B')]
public function benchHasClassAgain(): bool
{
return $this->reflectionProvider()->hasClass('MemoizingReflectionProviderBench\Member');
Expand All @@ -43,13 +43,13 @@ public function benchHasClassAgain(): bool
/**
* The memo is case-insensitive since 2.1.34, like class names.
*/
#[Expected(instructions: '2.166K', cycles: '26.82K', memory: '64B')]
#[Expected(instructions: '2.166K', cycles: '19.32K', memory: '64B')]
public function benchHasClassInOtherCase(): bool
{
return $this->reflectionProvider()->hasClass('memoizingReflectionProviderBench\member');
}

#[Expected(instructions: '2.345K', cycles: '29.09K', memory: '64B')]
#[Expected(instructions: '2.345K', cycles: '21.14K', memory: '64B')]
public function benchGetClassAgain(): ClassReflection
{
return $this->reflectionProvider()->getClass('MemoizingReflectionProviderBench\Member');
Expand Down
2 changes: 1 addition & 1 deletion tests/bench/MutatingScopeArrayDimFetchBench.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function boot(int $keys): void
* Specifying an offset also specifies the array: an array is offset-accessible already.
*/
#[DataProvider(method: 'arrays')]
#[ExpectedFor(dataSet: 'general-array', instructions: '132.8K', cycles: '508.2K', memory: '4.516KiB')]
#[ExpectedFor(dataSet: 'general-array', instructions: '132.8K', cycles: '481.3K', memory: '4.516KiB')]
#[ExpectedFor(dataSet: 'shape-32', instructions: '196.2K', cycles: '683.9K', memory: '6.398KiB')]
public function benchSpecifyArrayDimFetchType(int $keys): MutatingScope
{
Expand Down
Loading
Loading