Skip to content

Cache scope calculation #23

@steghoja

Description

@steghoja

Now that issue #5 is closed, we can think of some optimisations.

Right now, we’re doing a pretty expensive computation whenever the scope is needed. We load all other resources from disk, parse them, and construct the global scope. This does not need to happen every time getScope() is called. We can cache the results and, if the same scope is requested again, just return the result from the cache.

Xtext provides a MapBasedScope which uses a HashMap as a cache: https://github.com/eclipse/xtext-core/blob/master/org.eclipse.xtext/src/org/eclipse/xtext/scoping/impl/MapBasedScope.java
Maybe we can do something similar?

There’s even more: we really only need to load the other files once when getScope() is called first. Later, we should check if any of the resources has been modified, though, to make sure we pick up on any changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions