Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance issue #5

Closed
moufmouf opened this issue Sep 6, 2018 · 9 comments
Closed

Performance issue #5

moufmouf opened this issue Sep 6, 2018 · 9 comments
Milestone

Comments

@moufmouf
Copy link
Member

@moufmouf moufmouf commented Sep 6, 2018

Scanning of lib.php by PHPStorm alone takes several minutes.
We should also check performance for PHP.

TODO: try to split the file in several smaller files?

@moufmouf
Copy link
Member Author

@moufmouf moufmouf commented Sep 6, 2018

Some measures:

When everything function is in one single big file:

  • nb functions: 1426
  • nb lines: 46514
  • file size: 1.3M
  • time to index in PHPStorm: 3m42s
@moufmouf
Copy link
Member Author

@moufmouf moufmouf commented Sep 6, 2018

Results after splitting functions in 128 files:

  • nb functions: 128
  • nb lines: 48449
  • files size (total): 1.5M
  • average file size: 12k
  • time to index in PHPStorm: 3s (!!!)
@MaXal
Copy link

@MaXal MaXal commented Sep 6, 2018

The difference shouldn't be so enormous! Is it possible to attach lib.php? We (PhpStorm team) would glad to investigate what is going on.

@moufmouf moufmouf added this to the 1.0 milestone Sep 6, 2018
@moufmouf moufmouf closed this in #6 Sep 6, 2018
@moufmouf moufmouf reopened this Sep 6, 2018
@moufmouf
Copy link
Member Author

@moufmouf moufmouf commented Sep 6, 2018

Hey @MaXal

With pleasure. File is here:

lib.zip

It takes about 3 minutes to index with latest version of PHPStorm (2018.2)

And I'm not having this problem if file is splitted in 128 smaller files (I'm in the process of commiting those, so they will be in the repository by tomorrow).

@MaXal
Copy link

@MaXal MaXal commented Sep 7, 2018

Thanks a lot! Reproduced: https://youtrack.jetbrains.com/issue/WI-43453

@moufmouf
Copy link
Member Author

@moufmouf moufmouf commented Sep 7, 2018

Cool. Happy to help if I can.
I'll close this issue since this is now in your hands :)

@moufmouf moufmouf closed this Sep 7, 2018
@neuro159
Copy link

@neuro159 neuro159 commented Sep 7, 2018

CC: 2M file with 2853 non-absolute Exceptions namespace reference eg @throws Exceptions\ApacheException -> was a full file scan for use for each ref.
Note: such syntax is DISCOURAGED. Workaround -> always use absolute NS ref in such cases!
Anyway, fixed PhpStorm for this case: ns total ref resolve local 5 min->100ms on indexing (or typing)

@neuro159
Copy link

@neuro159 neuro159 commented Sep 7, 2018

You guys might want to change all those
@throws Exceptions\ApacheException
to
@throws \Exceptions\ApacheException

@moufmouf
Copy link
Member Author

@moufmouf moufmouf commented Sep 10, 2018

Woot! That was fast. Thanks a lot @neuro159 !
And I'll sure fix the relative reference!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants