diff --git a/composer.lock b/composer.lock index d4cf2e7a9ff..4487df6fbf1 100644 --- a/composer.lock +++ b/composer.lock @@ -4209,12 +4209,12 @@ "source": { "type": "git", "url": "https://github.com/phpstan/tally.git", - "reference": "983007834286c7970a8a88b9e5428832ff42a3a0" + "reference": "e67008ced513658b84e40992268763385218b228" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpstan/tally/zipball/983007834286c7970a8a88b9e5428832ff42a3a0", - "reference": "983007834286c7970a8a88b9e5428832ff42a3a0", + "url": "https://api.github.com/repos/phpstan/tally/zipball/e67008ced513658b84e40992268763385218b228", + "reference": "e67008ced513658b84e40992268763385218b228", "shasum": "" }, "require": { @@ -4253,8 +4253,8 @@ "issues": "https://github.com/phpstan/tally/issues", "source": "https://github.com/phpstan/tally/tree/release/1.x" }, - "time": "2026-11-14T07:38:21+00:00", - "published-time": "2026-11-14T07:38:28+00:00" + "time": "2026-11-14T11:09:44+00:00", + "published-time": "2026-11-14T11:09:50+00:00" }, { "name": "phpunit/php-code-coverage", diff --git a/tally.php b/tally.php index c739f54e7d1..cb8bba4342e 100644 --- a/tally.php +++ b/tally.php @@ -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); diff --git a/tests/bench/AcceptsResultBench.php b/tests/bench/AcceptsResultBench.php index 1c2d5f6db84..26310b01302 100644 --- a/tests/bench/AcceptsResultBench.php +++ b/tests/bench/AcceptsResultBench.php @@ -52,7 +52,7 @@ 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 { @@ -60,7 +60,7 @@ public function benchMaxMin(int $results): AcceptsResult } #[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 { @@ -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 { diff --git a/tests/bench/ArgumentsNormalizerBench.php b/tests/bench/ArgumentsNormalizerBench.php index 5db49228a78..e823f4d9939 100644 --- a/tests/bench/ArgumentsNormalizerBench.php +++ b/tests/bench/ArgumentsNormalizerBench.php @@ -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) { diff --git a/tests/bench/BetterReflectionProviderBench.php b/tests/bench/BetterReflectionProviderBench.php index 7ce706b505e..551b40400be 100644 --- a/tests/bench/BetterReflectionProviderBench.php +++ b/tests/bench/BetterReflectionProviderBench.php @@ -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) { diff --git a/tests/bench/BetterReflectionSourceLocatorFactoryBench.php b/tests/bench/BetterReflectionSourceLocatorFactoryBench.php index e28922808cd..53e5b1b231d 100644 --- a/tests/bench/BetterReflectionSourceLocatorFactoryBench.php +++ b/tests/bench/BetterReflectionSourceLocatorFactoryBench.php @@ -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) { diff --git a/tests/bench/ClassReflectionBench.php b/tests/bench/ClassReflectionBench.php index 526afacc28c..6125219e06e 100644 --- a/tests/bench/ClassReflectionBench.php +++ b/tests/bench/ClassReflectionBench.php @@ -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) @@ -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(); diff --git a/tests/bench/CollectorsRegistryBench.php b/tests/bench/CollectorsRegistryBench.php index ab7747f6fb3..250b3c88ccf 100644 --- a/tests/bench/CollectorsRegistryBench.php +++ b/tests/bench/CollectorsRegistryBench.php @@ -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) { diff --git a/tests/bench/ComposerHelperBench.php b/tests/bench/ComposerHelperBench.php index 27b46d92894..542bf061c8c 100644 --- a/tests/bench/ComposerHelperBench.php +++ b/tests/bench/ComposerHelperBench.php @@ -32,7 +32,7 @@ public function boot(): void * * @return array|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); diff --git a/tests/bench/ConstantArrayTypeBench.php b/tests/bench/ConstantArrayTypeBench.php index 9acc3121ea7..0f47922b4a9 100644 --- a/tests/bench/ConstantArrayTypeBench.php +++ b/tests/bench/ConstantArrayTypeBench.php @@ -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 { @@ -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) { diff --git a/tests/bench/ConstantArrayTypePhp74Bench.php b/tests/bench/ConstantArrayTypePhp74Bench.php index 9ae4fbabbaf..6c53503870e 100644 --- a/tests/bench/ConstantArrayTypePhp74Bench.php +++ b/tests/bench/ConstantArrayTypePhp74Bench.php @@ -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; diff --git a/tests/bench/ConstantStringTypeBench.php b/tests/bench/ConstantStringTypeBench.php index e0b3be39eaa..57271a21cd3 100644 --- a/tests/bench/ConstantStringTypeBench.php +++ b/tests/bench/ConstantStringTypeBench.php @@ -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(); diff --git a/tests/bench/DependencyResolverBench.php b/tests/bench/DependencyResolverBench.php index 270fb7a4e43..02353a02733 100644 --- a/tests/bench/DependencyResolverBench.php +++ b/tests/bench/DependencyResolverBench.php @@ -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) { diff --git a/tests/bench/ExpressionTypeHolderBench.php b/tests/bench/ExpressionTypeHolderBench.php index a15327f784c..31cac8ebc94 100644 --- a/tests/bench/ExpressionTypeHolderBench.php +++ b/tests/bench/ExpressionTypeHolderBench.php @@ -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(); @@ -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) { diff --git a/tests/bench/FileCacheStorageBench.php b/tests/bench/FileCacheStorageBench.php index 55a093f41d0..79c3b93dab7 100644 --- a/tests/bench/FileCacheStorageBench.php +++ b/tests/bench/FileCacheStorageBench.php @@ -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) { diff --git a/tests/bench/FileCacheStorageMissBench.php b/tests/bench/FileCacheStorageMissBench.php index a1c1fe74a0f..441e1227548 100644 --- a/tests/bench/FileCacheStorageMissBench.php +++ b/tests/bench/FileCacheStorageMissBench.php @@ -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) { diff --git a/tests/bench/GenericObjectTypeCheckBench.php b/tests/bench/GenericObjectTypeCheckBench.php index f7d53597b88..53df03c8909 100644 --- a/tests/bench/GenericObjectTypeCheckBench.php +++ b/tests/bench/GenericObjectTypeCheckBench.php @@ -50,7 +50,7 @@ public function boot(int $keys): void * @return list */ #[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 { diff --git a/tests/bench/GenericParametersAcceptorResolverBench.php b/tests/bench/GenericParametersAcceptorResolverBench.php index d10bdbfa158..ebf2942ad8a 100644 --- a/tests/bench/GenericParametersAcceptorResolverBench.php +++ b/tests/bench/GenericParametersAcceptorResolverBench.php @@ -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 { diff --git a/tests/bench/HashFunctionsReturnTypeExtensionBench.php b/tests/bench/HashFunctionsReturnTypeExtensionBench.php index 6aa5921d8f0..985d381a0a9 100644 --- a/tests/bench/HashFunctionsReturnTypeExtensionBench.php +++ b/tests/bench/HashFunctionsReturnTypeExtensionBench.php @@ -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) diff --git a/tests/bench/InitializerExprTypeResolverBench.php b/tests/bench/InitializerExprTypeResolverBench.php index 8ea39d438e5..d1bdb697c03 100644 --- a/tests/bench/InitializerExprTypeResolverBench.php +++ b/tests/bench/InitializerExprTypeResolverBench.php @@ -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) { @@ -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 { diff --git a/tests/bench/IntersectionTypeBench.php b/tests/bench/IntersectionTypeBench.php index 1cbafe9863e..eb81b7fb341 100644 --- a/tests/bench/IntersectionTypeBench.php +++ b/tests/bench/IntersectionTypeBench.php @@ -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 { diff --git a/tests/bench/IsSuperTypeOfResultBench.php b/tests/bench/IsSuperTypeOfResultBench.php index d799cc987be..b1e7011b08b 100644 --- a/tests/bench/IsSuperTypeOfResultBench.php +++ b/tests/bench/IsSuperTypeOfResultBench.php @@ -64,7 +64,7 @@ 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 { @@ -72,7 +72,7 @@ public function benchMaxMin(int $results): IsSuperTypeOfResult } #[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 { @@ -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 { diff --git a/tests/bench/LoaderFactoryBench.php b/tests/bench/LoaderFactoryBench.php index e8ca5ffb0da..51483dd9723 100644 --- a/tests/bench/LoaderFactoryBench.php +++ b/tests/bench/LoaderFactoryBench.php @@ -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) { diff --git a/tests/bench/MemoizingReflectionProviderBench.php b/tests/bench/MemoizingReflectionProviderBench.php index 5870272a3db..2b1c9575547 100644 --- a/tests/bench/MemoizingReflectionProviderBench.php +++ b/tests/bench/MemoizingReflectionProviderBench.php @@ -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'); @@ -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'); diff --git a/tests/bench/MutatingScopeArrayDimFetchBench.php b/tests/bench/MutatingScopeArrayDimFetchBench.php index 41cd18a5890..34e94031c15 100644 --- a/tests/bench/MutatingScopeArrayDimFetchBench.php +++ b/tests/bench/MutatingScopeArrayDimFetchBench.php @@ -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 { diff --git a/tests/bench/MutatingScopeBench.php b/tests/bench/MutatingScopeBench.php index f775fabeaba..db5b432cea9 100644 --- a/tests/bench/MutatingScopeBench.php +++ b/tests/bench/MutatingScopeBench.php @@ -74,7 +74,7 @@ public function boot(): void /** * The certainty is looked up once (#4726). */ - #[Expected(instructions: '2.247K', cycles: '26.67K', memory: '32B')] + #[Expected(instructions: '2.247K', cycles: '19.93K', memory: '32B')] public function benchGetVariableType(): Type { return $this->scope()->getVariableType('i'); @@ -101,7 +101,7 @@ public static function keepVoidExprs(): iterable #[DataProvider(method: 'keepVoidExprs')] #[ExpectedFor(dataSet: 'func-call', instructions: '389.4K', cycles: '1.305M', memory: '15.49KiB')] - #[ExpectedFor(dataSet: 'variable', instructions: '7.615K', cycles: '68.25K', memory: '128B')] + #[ExpectedFor(dataSet: 'variable', instructions: '7.615K', cycles: '55.59K', memory: '128B')] public function benchGetKeepVoidType(string $expr): Type { return $this->scope()->getKeepVoidType($expr === 'variable' ? new Expr\Variable('str') : self::funcCall('trim')); @@ -119,7 +119,7 @@ public function benchGetTypeOfFuncCall(): Type /** * Creates a scope, without getting the parser from the container each time (#4672). */ - #[Expected(instructions: '11.82K', cycles: '76.11K', memory: '944B')] + #[Expected(instructions: '11.82K', cycles: '57.24K', memory: '944B')] public function benchPushInFunctionCall(): MutatingScope { return $this->scope()->pushInFunctionCall(null, null, true); @@ -128,7 +128,7 @@ public function benchPushInFunctionCall(): MutatingScope /** * An argument's type resolved before is not resolved again (#4648). */ - #[Expected(instructions: '52.32K', cycles: '243.5K', memory: '3.086KiB')] + #[Expected(instructions: '52.32K', cycles: '219.8K', memory: '3.086KiB')] public function benchPushInFunctionCallGetType(): Type { return $this->scope()->pushInFunctionCall(null, null, true)->getType(self::resolvedExpr()); @@ -137,7 +137,7 @@ public function benchPushInFunctionCallGetType(): Type /** * A scalar's type is not stored (#4663). */ - #[Expected(instructions: '3.965K', cycles: '38.75K', memory: '176B')] + #[Expected(instructions: '3.965K', cycles: '23.76K', memory: '176B')] public function benchSpecifyScalarType(): MutatingScope { return $this->scope()->specifyExpressionType(new String_('x'), new StringType(), new StringType(), TrinaryLogic::createYes()); @@ -178,7 +178,7 @@ public function benchAssignPropertyFetch(): MutatingScope /** * Finds the expressions on $this by their keys, not by searching them (#4697). */ - #[Expected(instructions: '65.96K', cycles: '185.2K', memory: '16.61KiB')] + #[Expected(instructions: '66.12K', cycles: '169.7K', memory: '16.61KiB')] public function benchRestoreThis(): MutatingScope { $scope = $this->scope(); diff --git a/tests/bench/MutatingScopeBranchMergeBench.php b/tests/bench/MutatingScopeBranchMergeBench.php index be8eb44e396..19cddd21899 100644 --- a/tests/bench/MutatingScopeBranchMergeBench.php +++ b/tests/bench/MutatingScopeBranchMergeBench.php @@ -73,7 +73,7 @@ public function boot(string $shape, int $variables): void #[ExpectedFor(dataSet: 'differing-unions-16', instructions: '16.78M', cycles: '20.46M', memory: '599.2KiB')] #[ExpectedFor(dataSet: 'maybe-defined-64', instructions: '747.8K', cycles: '1.081M', memory: '18.58KiB')] #[ExpectedFor(dataSet: 'one-sided-64', instructions: '1.405M', cycles: '2.004M', memory: '50.22KiB')] - #[ExpectedFor(dataSet: 'shared-holders-16', instructions: '153.0K', cycles: '426.3K', memory: '9.445KiB')] + #[ExpectedFor(dataSet: 'shared-holders-16', instructions: '153.0K', cycles: '400.9K', memory: '9.445KiB')] #[ExpectedFor(dataSet: 'shared-holders-256', instructions: '1.372M', cycles: '2.123M', memory: '121.9KiB')] public function benchMergeWith(string $shape, int $variables): MutatingScope { diff --git a/tests/bench/MutatingScopeImpureCallsBench.php b/tests/bench/MutatingScopeImpureCallsBench.php index bba9670d348..3fad4d5905c 100644 --- a/tests/bench/MutatingScopeImpureCallsBench.php +++ b/tests/bench/MutatingScopeImpureCallsBench.php @@ -44,7 +44,7 @@ public function boot(): void /** * Merging two branches after calls to user functions and methods that are possibly impure. */ - #[Expected(instructions: '75.45K', cycles: '307.0K', memory: '3.523KiB')] + #[Expected(instructions: '75.45K', cycles: '103.6K', memory: '3.523KiB')] public function benchMergeWithAfterPossiblyImpureCalls(): MutatingScope { if ($this->scope === null || $this->otherScope === null) { diff --git a/tests/bench/MutatingScopeMergeBench.php b/tests/bench/MutatingScopeMergeBench.php index 18ddc89ed8d..417937d3c06 100644 --- a/tests/bench/MutatingScopeMergeBench.php +++ b/tests/bench/MutatingScopeMergeBench.php @@ -63,7 +63,7 @@ public function boot(string $merge): void #[DataProvider(method: 'merges')] #[ExpectedFor(dataSet: 'property-fetches-on-one-side', instructions: '1.749M', cycles: '2.291M', memory: '82.25KiB')] - #[ExpectedFor(dataSet: 'same-scope', instructions: '1.083K', cycles: '11.64K', memory: '0B')] + #[ExpectedFor(dataSet: 'same-scope', instructions: '1.083K', cycles: '8.813K', memory: '0B')] #[ExpectedFor(dataSet: 'variables-on-one-side', instructions: '890.9K', cycles: '1.271M', memory: '53.26KiB')] public function benchMergeWith(string $merge): MutatingScope { diff --git a/tests/bench/NetteContainerBench.php b/tests/bench/NetteContainerBench.php index 1ef69ceba63..f5fc1999f44 100644 --- a/tests/bench/NetteContainerBench.php +++ b/tests/bench/NetteContainerBench.php @@ -24,7 +24,7 @@ public function boot(): void $this->container->getParameter('tmpDir'); } - #[Expected(instructions: '1.051K', cycles: '12.71K', memory: '0B')] + #[Expected(instructions: '1.051K', cycles: '9.651K', memory: '0B')] public function benchGetParameter(): mixed { if ($this->container === null) { @@ -34,7 +34,7 @@ public function benchGetParameter(): mixed return $this->container->getParameter('tmpDir'); } - #[Expected(instructions: '1.529K', cycles: '16.16K', memory: '0B')] + #[Expected(instructions: '1.529K', cycles: '12.22K', memory: '0B')] public function benchHasParameter(): bool { if ($this->container === null) { diff --git a/tests/bench/NullsafeOperatorHelperBench.php b/tests/bench/NullsafeOperatorHelperBench.php index 83d6395637e..adc42d75d8d 100644 --- a/tests/bench/NullsafeOperatorHelperBench.php +++ b/tests/bench/NullsafeOperatorHelperBench.php @@ -83,7 +83,7 @@ public function boot(int $depth, bool $nullsafe): void * The analyser asks about each level of a chain, innermost first. */ #[DataProvider(method: 'levelsWithoutNullsafe')] - #[ExpectedFor(dataSet: 'levels-16', instructions: '74.18K', cycles: '132.2K', memory: '6.242KiB')] + #[ExpectedFor(dataSet: 'levels-16', instructions: '74.18K', cycles: '124.6K', memory: '6.242KiB')] #[ExpectedFor(dataSet: 'levels-64', instructions: '283.4K', cycles: '379.1K', memory: '23.87KiB')] public function benchGetNullsafeShortcircuitedExprOfEveryLevel(int $depth, bool $nullsafe): int { @@ -118,7 +118,7 @@ public function benchGetNullsafeShortcircuitedExpr(int $depth, bool $nullsafe): * A chain without a nullsafe link needs no type from the scope. */ #[DataProvider(method: 'chainsWithoutNullsafe')] - #[ExpectedFor(dataSet: 'without-nullsafe-8', instructions: '27.17K', cycles: '75.85K', memory: '3.305KiB')] + #[ExpectedFor(dataSet: 'without-nullsafe-8', instructions: '27.17K', cycles: '67.74K', memory: '3.305KiB')] public function benchGetNullsafeShortcircuitedExprRespectingScope(int $depth, bool $nullsafe): Expr { if ($this->scope === null || $this->chain === null) { diff --git a/tests/bench/ObjectTypeBench.php b/tests/bench/ObjectTypeBench.php index ba3891124be..1bde3569fe6 100644 --- a/tests/bench/ObjectTypeBench.php +++ b/tests/bench/ObjectTypeBench.php @@ -42,8 +42,8 @@ public function boot(string $className): void * The type was asked for its class before. */ #[DataProvider(method: 'classes')] - #[ExpectedFor(dataSet: 'class', instructions: '741', cycles: '9.321K', memory: '0B')] - #[ExpectedFor(dataSet: 'generic-class', instructions: '741', cycles: '9.321K', memory: '0B')] + #[ExpectedFor(dataSet: 'class', instructions: '741', cycles: '6.371K', memory: '0B')] + #[ExpectedFor(dataSet: 'generic-class', instructions: '741', cycles: '6.361K', memory: '0B')] public function benchGetClassReflection(string $className): ?ClassReflection { if ($this->object === null) { diff --git a/tests/bench/ObjectTypeIsSuperTypeOfBench.php b/tests/bench/ObjectTypeIsSuperTypeOfBench.php index e081bed7410..08c9787d59e 100644 --- a/tests/bench/ObjectTypeIsSuperTypeOfBench.php +++ b/tests/bench/ObjectTypeIsSuperTypeOfBench.php @@ -44,7 +44,7 @@ public function boot(): void $this->dateTime->isSuperTypeOf($this->union); } - #[Expected(instructions: '252.2K', cycles: '311.5K', memory: '368B')] + #[Expected(instructions: '252.2K', cycles: '295.4K', memory: '368B')] public function benchIsSuperTypeOfUnrelatedClass(): IsSuperTypeOfResult { if ($this->dateTime === null || $this->exception === null) { diff --git a/tests/bench/PackageDependencyResolverBench.php b/tests/bench/PackageDependencyResolverBench.php index bd0e8f4daca..9b86058fe89 100644 --- a/tests/bench/PackageDependencyResolverBench.php +++ b/tests/bench/PackageDependencyResolverBench.php @@ -50,8 +50,8 @@ public function boot(string $file): void * Every analysed file that depends on a file resolves it again. */ #[DataProvider(method: 'files')] - #[ExpectedFor(dataSet: 'package-file', instructions: '1.082K', cycles: '11.64K', memory: '0B')] - #[ExpectedFor(dataSet: 'project-file', instructions: '1.082K', cycles: '11.64K', memory: '0B')] + #[ExpectedFor(dataSet: 'package-file', instructions: '1.082K', cycles: '9.792K', memory: '0B')] + #[ExpectedFor(dataSet: 'project-file', instructions: '1.082K', cycles: '9.902K', memory: '0B')] public function benchResolvePackageAgain(string $file): ?string { if ($this->resolver === null) { diff --git a/tests/bench/ParametersAcceptorSelectorBench.php b/tests/bench/ParametersAcceptorSelectorBench.php index caee9ce134e..c8094664af9 100644 --- a/tests/bench/ParametersAcceptorSelectorBench.php +++ b/tests/bench/ParametersAcceptorSelectorBench.php @@ -61,8 +61,8 @@ public function boot(int $items, bool $templateFirst): void */ #[DataProvider(method: 'returnTypes')] #[ExpectedFor(dataSet: 'no-template-256', instructions: '543.0K', cycles: '1.047M', memory: '0B')] - #[ExpectedFor(dataSet: 'template-first-16', instructions: '1.876K', cycles: '19.70K', memory: '0B')] - #[ExpectedFor(dataSet: 'template-first-256', instructions: '1.876K', cycles: '19.70K', memory: '0B')] + #[ExpectedFor(dataSet: 'template-first-16', instructions: '1.876K', cycles: '15.70K', memory: '0B')] + #[ExpectedFor(dataSet: 'template-first-256', instructions: '1.876K', cycles: '15.58K', memory: '0B')] public function benchHasAcceptorTemplateOrLateResolvableType(int $items, bool $templateFirst): bool { if ($this->hasTemplateOrLateResolvableType === null || $this->acceptor === null) { diff --git a/tests/bench/PathRoutingParserBench.php b/tests/bench/PathRoutingParserBench.php index c90f8809b44..c48419ee0a9 100644 --- a/tests/bench/PathRoutingParserBench.php +++ b/tests/bench/PathRoutingParserBench.php @@ -50,8 +50,8 @@ public function boot(string $file): void * @return Node[] */ #[DataProvider(method: 'stubs')] - #[ExpectedFor(dataSet: 'class', instructions: '6.901K', cycles: '63.71K', memory: '0B')] - #[ExpectedFor(dataSet: 'function', instructions: '6.901K', cycles: '63.72K', memory: '0B')] + #[ExpectedFor(dataSet: 'class', instructions: '6.901K', cycles: '57.94K', memory: '0B')] + #[ExpectedFor(dataSet: 'function', instructions: '6.893K', cycles: '57.97K', memory: '0B')] public function benchParsePhp8StubAgain(string $file): array { if ($this->parser === null) { diff --git a/tests/bench/Php8SignatureMapProviderBench.php b/tests/bench/Php8SignatureMapProviderBench.php index 032f72b36f9..0d20ba6923f 100644 --- a/tests/bench/Php8SignatureMapProviderBench.php +++ b/tests/bench/Php8SignatureMapProviderBench.php @@ -48,9 +48,9 @@ public function boot(): void * @param list $methods */ #[DataProvider(method: 'members')] - #[ExpectedFor(dataSet: 'constants-1', instructions: '4.015K', cycles: '36.03K', memory: '136B')] - #[ExpectedFor(dataSet: 'constants-8', instructions: '28.44K', cycles: '65.63K', memory: '144B')] - #[ExpectedFor(dataSet: 'constants-8-methods-8', instructions: '55.67K', cycles: '101.5K', memory: '144B')] + #[ExpectedFor(dataSet: 'constants-1', instructions: '4.006K', cycles: '30.42K', memory: '136B')] + #[ExpectedFor(dataSet: 'constants-8', instructions: '28.36K', cycles: '60.06K', memory: '144B')] + #[ExpectedFor(dataSet: 'constants-8-methods-8', instructions: '55.54K', cycles: '96.26K', memory: '144B')] public function benchFindMembers(array $constants, array $methods): int { if ($this->provider === null) { diff --git a/tests/bench/PhpFunctionFromParserNodeReflectionBench.php b/tests/bench/PhpFunctionFromParserNodeReflectionBench.php index 55f82238af6..9e814ae1c4b 100644 --- a/tests/bench/PhpFunctionFromParserNodeReflectionBench.php +++ b/tests/bench/PhpFunctionFromParserNodeReflectionBench.php @@ -48,8 +48,8 @@ public function boot(int $statements): void * a yield unless the answer is memoized on its node. */ #[DataProvider(method: 'statements')] - #[ExpectedFor(dataSet: 'statements-16', instructions: '1.268K', cycles: '14.69K', memory: '0B')] - #[ExpectedFor(dataSet: 'statements-256', instructions: '1.268K', cycles: '14.69K', memory: '0B')] + #[ExpectedFor(dataSet: 'statements-16', instructions: '1.268K', cycles: '12.65K', memory: '0B')] + #[ExpectedFor(dataSet: 'statements-256', instructions: '1.268K', cycles: '12.64K', memory: '0B')] public function benchIsGeneratorAgain(int $statements): bool { if ($this->function === null) { diff --git a/tests/bench/PhpMethodReflectionBench.php b/tests/bench/PhpMethodReflectionBench.php index 49c3d5b2faa..eb13a8af13a 100644 --- a/tests/bench/PhpMethodReflectionBench.php +++ b/tests/bench/PhpMethodReflectionBench.php @@ -38,7 +38,7 @@ public function doubleValues(): void $this->method->getName(); } - #[Expected(instructions: '700', cycles: '8.840K', memory: '0B')] + #[Expected(instructions: '700', cycles: '5.670K', memory: '0B')] public function benchGetNameAgain(): string { if ($this->method === null) { diff --git a/tests/bench/RegexGroupParserBench.php b/tests/bench/RegexGroupParserBench.php index cc7285150af..bd0de43eace 100644 --- a/tests/bench/RegexGroupParserBench.php +++ b/tests/bench/RegexGroupParserBench.php @@ -38,7 +38,7 @@ public function boot(string $pattern): void #[DataProvider(method: 'patterns')] #[ExpectedFor(dataSet: 'date', instructions: '1.426M', cycles: '2.041M', memory: '9.656KiB')] - #[ExpectedFor(dataSet: 'unsupported-modifier', instructions: '1.286K', cycles: '15.92K', memory: '0B')] + #[ExpectedFor(dataSet: 'unsupported-modifier', instructions: '1.286K', cycles: '13.41K', memory: '0B')] public function benchParseGroupsAgain(string $pattern): bool { if ($this->parser === null) { diff --git a/tests/bench/ReturnTypeExtensionBench.php b/tests/bench/ReturnTypeExtensionBench.php index 6b7f9c6f4c3..b7e51ed8db1 100644 --- a/tests/bench/ReturnTypeExtensionBench.php +++ b/tests/bench/ReturnTypeExtensionBench.php @@ -91,12 +91,12 @@ public function boot(string $extension, string $code): void * @return list */ #[DataProvider(method: 'extensions')] - #[ExpectedFor(dataSet: 'array-chunk', instructions: '622.4K', cycles: '1.076M', memory: '23.70KiB')] - #[ExpectedFor(dataSet: 'array-column', instructions: '2.033M', cycles: '3.088M', memory: '10.32KiB')] - #[ExpectedFor(dataSet: 'date-non-constant-format', instructions: '72.79K', cycles: '163.2K', memory: '1016B')] - #[ExpectedFor(dataSet: 'preg-replace-string-subject', instructions: '1.029M', cycles: '1.676M', memory: '10.78KiB')] - #[ExpectedFor(dataSet: 'range-100000', instructions: '526.1K', cycles: '878.5K', memory: '16.39KiB')] - #[ExpectedFor(dataSet: 'str-replace-string-subject', instructions: '530.5K', cycles: '874.6K', memory: '2.594KiB')] + #[ExpectedFor(dataSet: 'array-chunk', instructions: '622.4K', cycles: '838.2K', memory: '23.70KiB')] + #[ExpectedFor(dataSet: 'array-column', instructions: '2.033M', cycles: '2.734M', memory: '10.32KiB')] + #[ExpectedFor(dataSet: 'date-non-constant-format', instructions: '72.79K', cycles: '85.26K', memory: '1016B')] + #[ExpectedFor(dataSet: 'preg-replace-string-subject', instructions: '1.029M', cycles: '1.416M', memory: '10.78KiB')] + #[ExpectedFor(dataSet: 'range-100000', instructions: '526.1K', cycles: '680.9K', memory: '16.39KiB')] + #[ExpectedFor(dataSet: 'str-replace-string-subject', instructions: '530.5K', cycles: '698.7K', memory: '2.594KiB')] public function benchGetTypeFromFunctionCall(string $extension, string $code): array { if ($this->extension === null) { diff --git a/tests/bench/RuleBench.php b/tests/bench/RuleBench.php index 763358a46d1..137dfdcfdba 100644 --- a/tests/bench/RuleBench.php +++ b/tests/bench/RuleBench.php @@ -124,25 +124,25 @@ public function boot(string $rule, string $code, ?int $phpVersion): void * @param class-string $rule */ #[DataProvider(method: 'rules')] - #[ExpectedFor(dataSet: 'call-private-method-through-static-final-class', instructions: '59.05K', cycles: '111.0K', memory: '0B')] + #[ExpectedFor(dataSet: 'call-private-method-through-static-final-class', instructions: '59.05K', cycles: '62.60K', memory: '0B')] #[ExpectedFor(dataSet: 'call-to-function-parameters-resolvable-types', instructions: '117.0M', cycles: '141.7M', memory: '13.45KiB')] - #[ExpectedFor(dataSet: 'call-to-method-statement-with-no-discard-dynamic-name', instructions: '20.65K', cycles: '50.36K', memory: '0B')] - #[ExpectedFor(dataSet: 'call-to-static-method-statement-with-no-discard-dynamic-name', instructions: '20.80K', cycles: '50.52K', memory: '0B')] - #[ExpectedFor(dataSet: 'dump-native-type-no-arguments', instructions: '21.29K', cycles: '48.81K', memory: '0B')] - #[ExpectedFor(dataSet: 'dump-phpdoc-type-no-arguments', instructions: '21.29K', cycles: '49.24K', memory: '0B')] - #[ExpectedFor(dataSet: 'dump-type-no-arguments', instructions: '21.29K', cycles: '48.80K', memory: '0B')] - #[ExpectedFor(dataSet: 'duplicate-class-declaration', instructions: '116.2K', cycles: '225.8K', memory: '0B')] - #[ExpectedFor(dataSet: 'duplicate-function-declaration', instructions: '163.0K', cycles: '296.3K', memory: '0B')] - #[ExpectedFor(dataSet: 'file-assert-one-argument', instructions: '21.25K', cycles: '49.98K', memory: '0B')] - #[ExpectedFor(dataSet: 'final-private-method-constructors', instructions: '138.0K', cycles: '236.5K', memory: '0B')] - #[ExpectedFor(dataSet: 'function-conditional-return-type-without-conditional-types', instructions: '143.7K', cycles: '258.3K', memory: '376B')] - #[ExpectedFor(dataSet: 'impossible-check-type-function-call', instructions: '6.246M', cycles: '8.939M', memory: '5.758KiB')] - #[ExpectedFor(dataSet: 'instantiation-restricted-constructor', instructions: '3.525M', cycles: '5.588M', memory: '6.531KiB')] - #[ExpectedFor(dataSet: 'node-connecting-visitor-attributes-no-arguments', instructions: '38.75K', cycles: '77.96K', memory: '40B')] - #[ExpectedFor(dataSet: 'old-php-parser4-class-outside-class', instructions: '20.21K', cycles: '44.86K', memory: '0B')] - #[ExpectedFor(dataSet: 'parameter-castable-to-string-diff-assoc', instructions: '6.028M', cycles: '7.718M', memory: '3.172KiB')] - #[ExpectedFor(dataSet: 'restricted-function-usage', instructions: '282.2K', cycles: '443.2K', memory: '848B')] - #[ExpectedFor(dataSet: 'restricted-method-usage', instructions: '376.2K', cycles: '607.7K', memory: '256B')] + #[ExpectedFor(dataSet: 'call-to-method-statement-with-no-discard-dynamic-name', instructions: '20.65K', cycles: '22.46K', memory: '0B')] + #[ExpectedFor(dataSet: 'call-to-static-method-statement-with-no-discard-dynamic-name', instructions: '20.80K', cycles: '22.27K', memory: '0B')] + #[ExpectedFor(dataSet: 'dump-native-type-no-arguments', instructions: '21.29K', cycles: '22.59K', memory: '0B')] + #[ExpectedFor(dataSet: 'dump-phpdoc-type-no-arguments', instructions: '21.29K', cycles: '22.58K', memory: '0B')] + #[ExpectedFor(dataSet: 'dump-type-no-arguments', instructions: '21.29K', cycles: '22.66K', memory: '0B')] + #[ExpectedFor(dataSet: 'duplicate-class-declaration', instructions: '116.1K', cycles: '126.1K', memory: '0B')] + #[ExpectedFor(dataSet: 'duplicate-function-declaration', instructions: '163.1K', cycles: '174.8K', memory: '0B')] + #[ExpectedFor(dataSet: 'file-assert-one-argument', instructions: '21.25K', cycles: '22.65K', memory: '0B')] + #[ExpectedFor(dataSet: 'final-private-method-constructors', instructions: '138.2K', cycles: '146.6K', memory: '0B')] + #[ExpectedFor(dataSet: 'function-conditional-return-type-without-conditional-types', instructions: '143.7K', cycles: '153.7K', memory: '376B')] + #[ExpectedFor(dataSet: 'impossible-check-type-function-call', instructions: '6.250M', cycles: '8.182M', memory: '5.758KiB')] + #[ExpectedFor(dataSet: 'instantiation-restricted-constructor', instructions: '3.525M', cycles: '4.949M', memory: '6.531KiB')] + #[ExpectedFor(dataSet: 'node-connecting-visitor-attributes-no-arguments', instructions: '38.75K', cycles: '40.87K', memory: '40B')] + #[ExpectedFor(dataSet: 'old-php-parser4-class-outside-class', instructions: '20.21K', cycles: '21.31K', memory: '0B')] + #[ExpectedFor(dataSet: 'parameter-castable-to-string-diff-assoc', instructions: '6.028M', cycles: '6.950M', memory: '3.172KiB')] + #[ExpectedFor(dataSet: 'restricted-function-usage', instructions: '282.2K', cycles: '347.2K', memory: '848B')] + #[ExpectedFor(dataSet: 'restricted-method-usage', instructions: '376.2K', cycles: '477.7K', memory: '256B')] public function benchProcessNode(string $rule, string $code, ?int $phpVersion): int { if ($this->rule === null) { diff --git a/tests/bench/TemplateTypeBench.php b/tests/bench/TemplateTypeBench.php index 76b8a4c241b..a384f23c94a 100644 --- a/tests/bench/TemplateTypeBench.php +++ b/tests/bench/TemplateTypeBench.php @@ -66,7 +66,7 @@ public function boot(int $members): void * T0 of int = 0, T1 of int = 1, …: the description of a default is guarded against recursion. */ #[DataProvider(method: 'members')] - #[ExpectedFor(dataSet: 'members-16', instructions: '150.0K', cycles: '261.1K', memory: '2.820KiB')] + #[ExpectedFor(dataSet: 'members-16', instructions: '150.0K', cycles: '243.8K', memory: '2.820KiB')] #[ExpectedFor(dataSet: 'members-256', instructions: '2.385M', cycles: '2.976M', memory: '10.51KiB')] public function benchDescribeWithDefault(int $members): string { @@ -109,7 +109,7 @@ private static function withDefaults(int $members): array * None of the strings is an int, so T is not inferred from any of them. */ #[DataProvider(method: 'members')] - #[ExpectedFor(dataSet: 'members-16', instructions: '72.31K', cycles: '193.8K', memory: '1.469KiB')] + #[ExpectedFor(dataSet: 'members-16', instructions: '72.31K', cycles: '173.6K', memory: '1.469KiB')] #[ExpectedFor(dataSet: 'members-256', instructions: '930.9K', cycles: '1.141M', memory: '32.22KiB')] public function benchInferTemplateTypesFromUnion(int $members): TemplateTypeMap { diff --git a/tests/bench/TemplateTypeHelperBench.php b/tests/bench/TemplateTypeHelperBench.php index 8c2a0aa684b..d88a70188c5 100644 --- a/tests/bench/TemplateTypeHelperBench.php +++ b/tests/bench/TemplateTypeHelperBench.php @@ -47,7 +47,7 @@ public function boot(int $keys): void * An array shape without template types, such as the return type of most functions. */ #[DataProvider(method: 'keys')] - #[ExpectedFor(dataSet: 'keys-16', instructions: '8.998K', cycles: '46.85K', memory: '0B')] + #[ExpectedFor(dataSet: 'keys-16', instructions: '8.998K', cycles: '40.68K', memory: '0B')] #[ExpectedFor(dataSet: 'keys-256', instructions: '95.16K', cycles: '205.0K', memory: '0B')] public function benchResolveTemplateTypes(int $keys): Type { diff --git a/tests/bench/TypeCombinatorBench.php b/tests/bench/TypeCombinatorBench.php index 5af4f0d84f6..8868e6c2593 100644 --- a/tests/bench/TypeCombinatorBench.php +++ b/tests/bench/TypeCombinatorBench.php @@ -178,7 +178,7 @@ public function benchUnionTaggedConstantArrays(int $types): Type } #[DataProvider(method: 'types')] - #[ExpectedFor(dataSet: 'types-16', instructions: '168.4K', cycles: '382.9K', memory: '8.875KiB')] + #[ExpectedFor(dataSet: 'types-16', instructions: '168.5K', cycles: '358.3K', memory: '8.875KiB')] #[ExpectedFor(dataSet: 'types-64', instructions: '601.1K', cycles: '919.0K', memory: '26.18KiB')] #[ExpectedFor(dataSet: 'types-256', instructions: '2.307M', cycles: '3.020M', memory: '107.7KiB')] public function benchIntersectBenevolentUnion(int $types): Type diff --git a/tests/bench/TypeNodeResolverBench.php b/tests/bench/TypeNodeResolverBench.php index 78c6ce49584..16d5c717458 100644 --- a/tests/bench/TypeNodeResolverBench.php +++ b/tests/bench/TypeNodeResolverBench.php @@ -55,7 +55,7 @@ public function boot(int $items): void * A non-empty-list shape gets both the list and the non-empty accessory. */ #[DataProvider(method: 'items')] - #[ExpectedFor(dataSet: 'items-4', instructions: '80.52K', cycles: '323.3K', memory: '5.430KiB')] + #[ExpectedFor(dataSet: 'items-4', instructions: '80.50K', cycles: '297.9K', memory: '5.430KiB')] #[ExpectedFor(dataSet: 'items-32', instructions: '545.4K', cycles: '854.6K', memory: '15.37KiB')] public function benchResolveNonEmptyListShape(int $items): Type { diff --git a/tests/bench/UnionTypeBench.php b/tests/bench/UnionTypeBench.php index 4eda0acad8d..ccbe8abba63 100644 --- a/tests/bench/UnionTypeBench.php +++ b/tests/bench/UnionTypeBench.php @@ -92,7 +92,7 @@ public function benchDescribeIntersections(int $members): string * The value types of the member arrays are unioned. */ #[DataProvider(method: 'members')] - #[ExpectedFor(dataSet: 'members-16', instructions: '151.6K', cycles: '310.4K', memory: '4.680KiB')] + #[ExpectedFor(dataSet: 'members-16', instructions: '151.6K', cycles: '286.2K', memory: '4.680KiB')] #[ExpectedFor(dataSet: 'members-64', instructions: '573.3K', cycles: '796.1K', memory: '12.18KiB')] #[ExpectedFor(dataSet: 'members-256', instructions: '2.259M', cycles: '2.771M', memory: '62.18KiB')] public function benchGetIterableValueType(int $members): Type diff --git a/tests/bench/UnresolvableTypeHelperBench.php b/tests/bench/UnresolvableTypeHelperBench.php index c9ef98f6352..a6b1b7b8fbe 100644 --- a/tests/bench/UnresolvableTypeHelperBench.php +++ b/tests/bench/UnresolvableTypeHelperBench.php @@ -56,8 +56,8 @@ public function boot(int $keys): void * once the first value is found, the rest of the type is not traversed. */ #[DataProvider(method: 'keys')] - #[ExpectedFor(dataSet: 'keys-16', instructions: '74.44K', cycles: '182.6K', memory: '6.461KiB')] - #[ExpectedFor(dataSet: 'keys-64', instructions: '260.1K', cycles: '413.9K', memory: '25.21KiB')] + #[ExpectedFor(dataSet: 'keys-16', instructions: '74.44K', cycles: '158.3K', memory: '6.461KiB')] + #[ExpectedFor(dataSet: 'keys-64', instructions: '260.1K', cycles: '387.2K', memory: '25.21KiB')] public function benchUnresolvableFirst(int $keys): bool { if ($this->type === null) { diff --git a/tests/bench/VarTagTypeRuleHelperBench.php b/tests/bench/VarTagTypeRuleHelperBench.php index 99a4965b45b..7cb35f2dff2 100644 --- a/tests/bench/VarTagTypeRuleHelperBench.php +++ b/tests/bench/VarTagTypeRuleHelperBench.php @@ -51,7 +51,7 @@ public function boot(): void * Without reportWrongPhpDocTypeInVarTag, only the native type of the expression is checked * against a @var tag that is not a PHPStan type. */ - #[Expected(instructions: '353.4K', cycles: '603.9K', memory: '984B')] + #[Expected(instructions: '353.4K', cycles: '467.9K', memory: '984B')] public function benchCheckExprTypeWithoutPhpDocCheck(): int { if ($this->helper === null || $this->varTagType === null) { diff --git a/tests/bench/VerbosityLevelBench.php b/tests/bench/VerbosityLevelBench.php index 9a53801225e..7a2eebed024 100644 --- a/tests/bench/VerbosityLevelBench.php +++ b/tests/bench/VerbosityLevelBench.php @@ -47,7 +47,7 @@ public function boot(int $values): void * so the arrays in the other values are not looked into. */ #[DataProvider(method: 'values')] - #[ExpectedFor(dataSet: 'values-16', instructions: '89.62K', cycles: '224.3K', memory: '2.508KiB')] + #[ExpectedFor(dataSet: 'values-16', instructions: '89.62K', cycles: '204.0K', memory: '2.508KiB')] #[ExpectedFor(dataSet: 'values-256', instructions: '749.4K', cycles: '937.2K', memory: '9.930KiB')] public function benchGetRecommendedLevelByType(int $values): VerbosityLevel { diff --git a/tests/bench/data/bug-4300.php b/tests/bench/data/bug-4300.php index c9da8541fae..deb0f93114c 100644 --- a/tests/bench/data/bug-4300.php +++ b/tests/bench/data/bug-4300.php @@ -1,9 +1,9 @@