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

Improves render performance during root selection #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Improves render performance during root selection #93

wants to merge 1 commit into from

Conversation

cars10
Copy link

@cars10 cars10 commented Mar 9, 2018

In :199 we select the roots by loading all values of opts[:boost][c.to_s] where c.to_s is an existing parent. If it does not exist as parent we get nil and throw that out with .compact in the end.

But we can use & beforehand to only loop through the ids that are present as parent, thus having fewer loops and removing the need to run .compact.

@the-teacher
Copy link
Owner

@cars10 Hey, your explanation sounds clear and I feel that your change has to improve this part of the code. But I'm afraid to break something if I merge this PR. Usually I use manual testing to be sure that everything is ok. Right now I don't have enough time to check it carefully.

I'm sorry for the delay. I like what you have done and I'll try to find time to check and merge it. Sorry, currently I don't work with ruby/rails too much to do it quickly.

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

Successfully merging this pull request may close these issues.

2 participants