[Nitro] Serious discussion on Annotaitons - Part II

George Moschovitis george.moschovitis at gmail.com
Mon Nov 13 03:46:38 EST 2006

> So it might not actually be worth it. It might just be better for Og to
> cache annotation reads, when possible, in areas of performance concern.

Ok, lets leave this to that.
> There is one other possiblity however, while it still would incur some
> penalty I expect it would be fairly lower. Instead of storing
> annotations in a hash, we could store them in class methods. Eg.
>   Bar.ann :foo, :class => Integer
> could translate into
>   def Bar.ann_foo
>     super + @ann_foo
>   end
>   @ann_foo += {:class => Integer}
> where #+ is an alias for Hash#merge.
> This essentially utilizes Ruby's internal inheritance features to do
> the the same thing my implementation does manually. So although it's
> doing the same thing, it should be fairly faster. It also means the
> basic notation for annotation lookup is:
>   C.ann_foo[:class]
> 'ann :foo, :class' notatio would of course translate into this.

very interesting idea, though I dont like the notation much. Let's
profile the current implementation first :)

> Me. Too. Facets has come a long way since 1.4+ series (now going on
> 1.8+). And it's ready to take another big step too. So I want to get
> Nitro/Og over to the latest and greatest before I start moving toward
> teh coold new features of 2.0. (2.0 might just blow people's minds ;)

Agreed ;-)



More information about the Nitro-general mailing list