From: Rich Kilmer Date: 2001-10-10T22:26:16+09:00 Subject: [ruby-talk:22382] Re: include vs. extend > -----Original Message----- > From: matz@ev.netlab.jp [mailto:matz@ev.netlab.jp]On Behalf Of Yukihiro > Matsumoto > Sent: Wednesday, October 10, 2001 1:20 AM > To: ruby-talk ML > Subject: [ruby-talk:22374] Re: include vs. extend > > > Hi, > > In message "[ruby-talk:22332] Re: include vs. extend" > on 01/10/10, Paul Brannan writes: > > |So in 3/4 cases, extend is (consistently) faster. Why is this? > > I don't know. If I'm right include and extend create same structures, > that only differ that extend creates per object structures. > > matz. I do not understand the internals of Ruby, I'm going of intuition... If I (include) within a class a module there is a new "hidden" combined class created that I then instantiate with objects. If I (extend) an object there is a new "hidden" combined class created for that object...is that right? I would think that doing this per object would have more overhead (because you are creating more of these classes/structures) vs. per class (where you create the class/structure once). -Rich