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

Implement custom delegators for drop methods #8183

Merged
merged 4 commits into from
Sep 23, 2020

Conversation

ashmaroli
Copy link
Member

Summary

While analyzing memory profile reports, I noticed that every call to a delegated method (generated by using Ruby's Forwardable module) results in allocation of an empty array.

So, I propose to use an in-house set of delegator factories that addresses the above observation.

@ashmaroli ashmaroli added this to the 4.2 milestone May 17, 2020
@ashmaroli
Copy link
Member Author

Memory Profile Summary

--- master https://travis-ci.org/github/jekyll/jekyll/jobs/687015473
+++ PR     https://travis-ci.org/github/jekyll/jekyll/jobs/687992324

- Total allocated: 299.74 MB (3113114 objects)
- Total retained:  19.37 MB (108879 objects)
+ Total allocated: 297.45 MB (3055734 objects)
+ Total retained:  19.37 MB (108887 objects)

@ashmaroli ashmaroli marked this pull request as ready for review August 26, 2020 14:39
@ashmaroli ashmaroli requested a review from a team August 26, 2020 14:39
@ashmaroli
Copy link
Member Author

@parkr @mattr- I would love it if you could take a look at the proposed changes here and provide feedback.
Thanks.

@ashmaroli
Copy link
Member Author

Workflow Summary

--- master https://github.com/jekyll/jekyll/runs/1130077147
+++ PR     https://github.com/jekyll/jekyll/runs/1133281825

- done in 25.671 seconds.
- done in 27.211 seconds.
- done in 25.857 seconds.
+ done in 24.043 seconds.
+ done in 25.37 seconds.
+ done in 24.911 seconds.

- Total allocated: 282.43 MB (2467827 objects)
+ Total allocated: 239.88 MB (1404029 objects)
  Total retained:  37.81 MB (112069 objects)

@ashmaroli ashmaroli added the memory-optimization ⚡ Reduced memory usage for the work done label Sep 18, 2020
Copy link
Member

@parkr parkr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is neat! Nice optimization.

@DirtyF
Copy link
Member

DirtyF commented Sep 23, 2020

@jekyll: merge +dev

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants