-
Notifications
You must be signed in to change notification settings - Fork 162
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
Reduce memory allocated when rendering the index page #559
Conversation
@@ -222,8 +222,8 @@ def search_paths=(path_array) | |||
# Don't allow the ignore to override things like gem tracking | |||
### | |||
def ignore=(ignored_array) | |||
ignored_array.map { |ignore_str| Regexp.new(ignore_str) } |
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.
Here was an attempt to convert keys to regexps, but because of the bug, this line was a no-op.
ignored_array.map { |ignore_str| Regexp.new(ignore_str) } | ||
@ignore = (@ignore + ignored_array).uniq | ||
ignored_array = ignored_array.map { |ignore_str| Regexp.new(ignore_str) } | ||
@ignore |= ignored_array |
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.
so I think we want to assign here with a uniq... the purpose of this is that folks can add overrides to ignores... traditionally those have always been strings... so it is good to fix the bug, but I think we still need the (@ignore + ignored_array).uniq
type logic.
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.
@ignore |= ignored_array
is the same as @ignore = (@ignore + ignored_array).uniq
.
Correct me if I am wrong.
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.
ha you are correct, I just don't use the single |=
very often... this works
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.
I think one issues on how ignore is extended
thanks it is great to get performance and memory enhancing PRs, I appreciate all the effort digging in on this @fatkodima |
this and all the other changes you submitted @fatkodima are in the 6.1.3 release https://github.com/danmayer/coverband/releases/tag/v6.1.3 |
Thank you! ❤️ Was waiting for it, going to try tomorrow. |
When rendering an index page, coverband makes a lot of unneeded allocations.
Before
After
So, it is now 40% less in my case.