[Gambas-devel] Multi-level virtual objects, inheritance and symbol resolution mess

Tobias Boege taboege at ...176...
Wed Sep 10 22:39:58 CEST 2014


On Wed, 10 Sep 2014, Beno?t Minisini wrote:
> > As each object can access its class very quickly, this would save
> > a hashtable lookup on object creation. Not a big saving but a question that
> > came to my mind.
> 
> I don't see how you can save a hashtable lookup (technically it's not a 
> hashtable, but something faster) if you look for the method "_getVertex" 
> with a specific signature.
> 

I meant: if I had a "tag" field in the CLASS structure for my component to
use freely (which I haven't, for good reasons, as you said), I could store
the structure of function pointers there after I scanned the interface and
if I need it with any object of that class, I can retrieve it in no time:

BEGIN_METHOD(Graph_getVertex, GB_STRING vert)

	GRAPH_DESC *desc = THIS->class->tag;

	/* desc->_getVertex() can be used now... */

END_METHOD

But I don't want to get trapped in premature optimisation here...

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk




More information about the Devel mailing list