-
Notifications
You must be signed in to change notification settings - Fork 541
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
Fix for #434. Reworked the Document's object cache dictionary. #435
Conversation
…The getObjectsByType() method now uses it correctly. The dictionary also should support subtype searches. Only one font is asked for and returned to get the default font.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @jee7 how is it going? |
Apologies, I did not get any notifications from your comments before.
|
No, in my opinion we should be as explicit about new things as possible (e.g. add return values etc.), but that doesn't mean we have to adapt the old code too. It can be updated later on during another PR or some refactoring. This way we have better code quality and understanding and don't need to rely on PHP doc.
Another Github Action could be used which only contains performance tests. You can copy |
Okay, how about now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your changes. Looks good, we are getting there!
…ations instead when able.
…ired (although this will likely never happen).
The Type Declaration should be now refactored to be better throughout. Other smaller fixes were done as well. Autoloading does not work. I asked the author of the PDF file if we can also host it. I'll let you know what he responds. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your adaptions.
But why did you refactored unrelated files too? It bloats your pull request and mixes improvements and unnecessary changes (like refactorings). We do such changes separately.
Here are some information why pull requests should be kept small: https://essenceofcode.com/2019/10/29/the-art-of-small-pull-requests/
Creating small, focused PRs creates a good invitation to your reviewer to provide quality feedback. Smaller PRs usually result in:
- Improved code quality
- Better feedback
- Faster feedback
- Increased understandability
- Better communication (with team members)
Please revert these changes so your pull request only contains optimizations towards a better object cache dictionary.
…rmance test to the repository. The author gave his approval.
Autoloading with running |
I understand your point. My suggestion to solve this issue would be that you move these changes into a separate branch and make another pull request. Finish this PR first or do refactoring before, as you like. What do you think? |
Okay. PR #440 now includes the PHPDoc / Type Declaration changes. |
Is this PR now dependent on #440? |
That would seem efficient, yes. When that gets approved, I can pull and merge it back into this PR. This will hopefully save a few hours of trying to put all the PHPDocs back here the way they were. |
@jee7 your PR with refactored code was merged. Can you solve merge conflicts so we can continue here? |
Should be good now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏿 Thank you, looks good!
I will keep this open for around week then I will merge.
The getObjectsByType() method now uses it correctly. The dictionary also should support subtype searches. Only one font is asked for and returned to get the default font.
This solution parses the 2 pages of the big PDF document linked in #434 in about the same time as v0.16.2 did (<0.1 sec per page). On my machine, it's 0.005 s for page 77 and 0.113 s for page 78 (comparable numbers to v0.16.2 speed).