Caching extracted names [message #660456] |
Fri, 18 March 2011 14:26 |
Mark Christiaens Messages: 63 Registered: October 2010 |
Member |
|
|
I was wondering if this piece of code from Xtext 2.0 is a good idea or not:
public static IScope scopeFor(Iterable<? extends EObject> elements, IScope outer) {
return scopeFor(elements, QualifiedName.wrapper(SimpleAttributeResolver.NAME_RESOLVER), outer);
}
As you can see, it uses a NAME_RESOLVER. That name-resolver seems to want to cache all the names extracted from the EObjects it analyzes. Is there any indication that such a cache is useful? My gut feeling tells me that extracting a name is cheap while using a synchronized cache (read/write lock) is not. In addition, I, for example, cache some of the results of my scoping at a higher level so this cache is probably generating a lot of misses.
---
Mark Christiaens
Discover the Future of VHDL Design
Go to www.sigasi.com
|
|
|
Powered by
FUDForum. Page generated in 0.02787 seconds