Skip to content
This repository has been archived by the owner on Jan 2, 2021. It is now read-only.

Speed up span lookups #292

Merged
merged 1 commit into from
Jan 6, 2020
Merged

Conversation

pepeiborra
Copy link
Collaborator

Following the first part of the discussion in #101,
and reusing some code from https://github.com/mpickering/ghcide/commits/wip/type-map.

An interval tree is used to speed up span lookups, which benefits hovers and
definition lookups. The computation of spans is still done using the same
algorithm as previously.

Fixes #247 by sorting matching spans by relevance.

@domenkozar
Copy link
Contributor

@pepeiborra this is great! Do you have some measurements of improvement?

@pepeiborra
Copy link
Collaborator Author

Very hard to measure, due to #254 (comment)

@domenkozar
Copy link
Contributor

@pepeiborra seems like that's fixed.

@pepeiborra
Copy link
Collaborator Author

pepeiborra commented Jan 5, 2020

No real speed up observed. Fail.

Looking up spans in a list is (unsurprisingly) way less expensive than type checking; I suspect that a module with enough spans to make the lookup operation noticeably slow would run out of memory during type checking.

I'll revert the interval tree change and keep just the fix for #247

EDIT: my performance tests are here: pepeiborra@f23b5ef

Copy link
Collaborator

@cocreature cocreature left a comment

Choose a reason for hiding this comment

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

Thank you!

@cocreature cocreature merged commit f8e6ab1 into haskell:master Jan 6, 2020
pepeiborra added a commit to pepeiborra/ghcide that referenced this pull request Feb 1, 2020
pepeiborra added a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
pepeiborra added a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
pepeiborra added a commit to pepeiborra/ide that referenced this pull request Dec 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Hover / goto def do not work for data constructors in record construction
3 participants