Skip to content

Performance problem - big arrays #8504

Closed

Description

@ondrejmirtes

Feature request

This file https://github.com/mmarton/phpstan-issue8146/blob/master/src/DataFixtures/LocationFixtures.php from #8146 really slows PHPStan down, because it contains a lot of literal arrays.

The performance was better before: phpstan/phpstan-src#1741

This PR phpstan/phpstan-src#1830 looked promising, it improved the performance on 1.8.x, but after rebasing on 1.9.x, it's slow again.

This PR phpstan/phpstan-src#2077 (basically a revert of phpstan/phpstan-src#1741) helps to solve this problem by dumbing down huge constant arrays (making types less precise) at the cost of new false positives because of the lost precision.

Activity

  1. ondrejmirtes commented on Dec 11, 2022

    @ondrejmirtes
    MemberAuthor

    The current result is that on 1.9.2, the sample project takes 2m34s to analyse, with 1.9.x-dev, it takes 47s! /cc @staabm

  2. staabm commented on Dec 11, 2022

    @staabm
    Contributor

    ahhh I love it. still too slow, but way better then before :)

  3. ondrejmirtes commented on Dec 20, 2022

    @ondrejmirtes
    MemberAuthor

    Should be better now after phpstan/phpstan-src#2116 and phpstan/phpstan-src#2077 :)

    Still need to investigate why #8004 fails on return.

  4. bcremer commented on Dec 21, 2022

    @bcremer

    Can confirm a reduction from 8 to 6 minutes for a bigger Laminas MVC application 🥳

  5. SaschaHowe commented on Jan 13, 2023

    @SaschaHowe

    Hey,

    just checked on this again. My Test case (this one: #8504 (comment)) went down for me this morning from 83.43s under 1.8.7 to 0.23s with 1.9.11. This is basically as good as it was prior to 1.8.7.

    Great work and thank you so much 👍

    Greetings,
    Sascha

  6. github-actions commented on Feb 14, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

  7. locked as resolved and limited conversation to collaborators on Feb 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions