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

Lift per_file_input_config outside of loop to avoid a potentially expensive clone #74

Merged
merged 1 commit into from
Oct 19, 2020

Conversation

DenialAdams
Copy link
Contributor

My input config had 118,000 file object - each with DataSource::Contents - so we were spending tons (n * n) of time cloning here when it's not necessary

By hoisting the clone out of the loop and mutating thereafter, we avoid the expensive cloning.

This reduced my index build time from just under 3 hours to 55 seconds

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.

None yet

2 participants