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

Fix possible quadratic performance bug in Backend.hs #2117

Merged
merged 1 commit into from
Jun 16, 2021

Conversation

pchiusano
Copy link
Member

@runarorama Randomly spotted this. The previous code would build a new relation for each entry in the map, rather than building it just once and doing multiple lookups into the relation.

This would be more noticeable when the query returns many terms and types. I'm not exactly sure how often that would be but still seemed worth fixing.

Laziness might help somewhat but even with laziness, it will have to force a lot of the relation in order to do a lookupRan. It's also possible that with optimizations turned on that common subexpression elimination hoists this out of the loop but I wouldn't necessarily count on that.

@pchiusano pchiusano requested a review from runarorama June 15, 2021 19:45
@runarorama runarorama merged commit becea9a into trunk Jun 16, 2021
@runarorama runarorama deleted the fix/server-performance-bug branch June 16, 2021 15:03
@pchiusano pchiusano mentioned this pull request Aug 20, 2021
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