-
Notifications
You must be signed in to change notification settings - Fork 185
Only hold content for open files in memory #60
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
Conversation
Current coverage is 90.67% (diff: 94.73%)@@ master #60 diff @@
==========================================
Files 23 23
Lines 496 504 +8
Methods 70 73 +3
Messages 0 0
Branches 0 0
==========================================
+ Hits 446 457 +11
+ Misses 50 47 -3
Partials 0 0
|
I think you need unset $statements too with removeContent() and not keep them in PhpDocument after parse(). Memory saving for magento after removing content from PhpDocument on close what just about 20% (630MiB => 500 MiB). |
Yeah but that will not work with current implementation of definition index, they reference AST node, which in turn references parent node, etc. 20% is at least something. I will look into completely removing the AST and only keeping an index of FQN => PhpDocument, then reparse the document on demand. |
Can we merge #35? Need to use |
Yes, will you do rebase? |
dd41b7b
to
1d5ee25
Compare
Actually let's merge this first, doesn't hurt. Any objections? |
Nothing from my side. |
Addressing #57 (comment)
Content is only set on
didOpen
, and removed ondidClose
.For indexing only the AST is kept.
It didn't reduce RAM usage unfortunately.