Menu

Is the result of a rule cached?

2013-07-12
2013-07-12
  • Jens von Pilgrim

    I'm wondering whether the result of a rule, in particular of an auxiliary function, is cached? E.g., I have an auxiliary functions

    auxiliary {
        superclasses(Class cl) : List<Class>
        allMembers(Class cl) : Iterable<Member>
            ...
    }
    

    which are quite expensive.

    Regards,
    Jens

     
  • Lorenzo Bettini

    Lorenzo Bettini - 2013-07-12

    At the moment there's no caching mechanism... I was thinking about adding caching, based on objects' references.

    However, I don't know whether this would make sense: when you write in the editor the AST model changes many times. Probably though Xtext should only rebuild the parts that really changed and the objects' identifiers should not change.

    I might try to add caching in the future, and it should not be too hard to implement (but first I'd like to port Xsemantics to Xtext 2.4.2).

     
  • Jens von Pilgrim

    Of course, updating to Xtext 2.4.2 is certainly more important.

    Still: The type system is created on the fly when needed, that is, it is not a singleton, is it? So, caching information there would be similar to caching in the scope provider, wouldn't it?

    As a workaround: could I use Gamma (G) as a kind of cache?

    Regards,
    Jens

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.