[reactor-users] reactor performance / getMetadata calls

4 views
Skip to first unread message

ElKlaaso

unread,
May 3, 2010, 10:03:46 AM5/3/10
to Reactor
Hi,

I found some things that will make reactor around 20% faster,
depending on how you use it ofcourse.

The abstractrecord and iterator have calls to getMetaData, which are
one of the slowest function calls according to a JRA recording i made
with JRockit.

The only check that is done (using getMetadata) is if the variable is
a CFC of type reactor.iterator.iterator.

So what i did is ive added a isIterator public method to the iterator
cfc, and i use structKeyExists(object,"isIterator") instead of
getMetadata.

Anyway, how to get this update officially into reactor?

I can supply the modified AbstractRecord.cfc and Iterator.cfc if you
want.

greets,
klaas

--
You received this message because you are subscribed to the Google Groups "Reactor" group.
To post to this group, send email to reacto...@googlegroups.com.
To unsubscribe from this group, send email to reactor-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/reactor-users?hl=en.

ElKlaaso

unread,
May 3, 2010, 10:40:00 AM5/3/10
to Reactor
Actually, it is 20-50 percent faster, thats quite a bit and worth
changing right?

Doug Hughes

unread,
May 3, 2010, 11:10:44 AM5/3/10
to reacto...@googlegroups.com
I'd support this..... Mark?

Doug Hughes, President
Alagad Inc.
dhu...@alagad.com
888 Alagad4 (x300)
Direct: 651 Alagad4 (651-252-4234)
Fax: 888-248-7836

Follow Alagad on Twitter: @alagadinc
Fan Alagad on Facebook: http://www.facebook.com/pages/Alagad/214035749318

Mark Drew

unread,
May 4, 2010, 10:09:16 AM5/4/10
to reacto...@googlegroups.com
I would support this too

I have a bunch of speed improvements I also made, such as caching mappings etc, which I need to synch up with my various instances. 

Send over the patch, add a ticket and we can commit it 

Regards

Mark Drew
Mark Drew
Railo Technologies UK
Professional Open Source
skype:  mark_railo
tel:  +44 7971 85  22 96

Klaas-Jan Winkel

unread,
May 4, 2010, 10:34:13 AM5/4/10
to reacto...@googlegroups.com
Maybe this sounds stupid but, where do i add a ticket?
--
Don't drink and park, accidents cause people

Mark Drew

unread,
May 4, 2010, 10:53:30 AM5/4/10
to reacto...@googlegroups.com

Klaas-Jan Winkel

unread,
May 6, 2010, 2:22:29 PM5/6/10
to reacto...@googlegroups.com
People, 
I have made an accoutn at http://www.reactorframework.org/
But i cant find any button or link anywhere to add a ticket..

greets,
klaas

Tom Chiverton

unread,
May 7, 2010, 8:48:46 AM5/7/10
to reacto...@googlegroups.com
On Thursday 06 May 2010 19:22:29 Klaas-Jan Winkel wrote:
> People,
> I have made an accoutn at http://www.reactorframework.org/
> <http://www.reactorframework.org/>But i cant find any button or link
> anywhere to add a ticket..

We've had spam problems in the past, so new accounts don't get the ability to
create them by default.
"ElKlaaso" now has the permission, you can find the link top tight, or just
click : http://www.reactorframework.org/newticket

--
Tom Chiverton
Helping to augmentatively lead metrics as part of the IT team of the year
2010, '09 and '08

****************************************************

This email is sent for and on behalf of Halliwells LLP.

Halliwells LLP is a limited liability partnership registered in England and Wales under registered number OC307980 whose registered office address is at Halliwells LLP, 3 Hardman Square, Spinningfields, Manchester, M3 3EB. A list of members is available for inspection at the registered office together with a list of those non members who are referred to as partners. We use the word ?partner? to refer to a member of the LLP, or an employee or consultant with equivalent standing and qualifications. Regulated by the Solicitors Regulation Authority.

CONFIDENTIALITY

This email is intended only for the use of the addressee named above and may be confidential or legally privileged. If you are not the addressee you must not read it and must not use any information contained in nor copy it nor inform any person other than Halliwells LLP or the addressee of its existence or contents. If you have received this email in error please delete it and notify Halliwells LLP IT Department on 0870 365 2500.

For more information about Halliwells LLP visit
www.Halliwells.com.

Mark Drew

unread,
May 7, 2010, 9:01:50 AM5/7/10
to reacto...@googlegroups.com
Thanks for sorting that out Tom! 

MD
Mark Drew
Railo Technologies UK
Professional Open Source
skype:  mark_railo
tel:  +44 7971 85  22 96

Klaas-Jan Winkel

unread,
May 8, 2010, 10:38:26 AM5/8/10
to reacto...@googlegroups.com
Ok, i will add the ticket soon.

In the meanwhile, i found that another method is quite slow, the isDirty method. Its called quite often within the framework, and it uses 2 getmetadata calls. The problem here is that it compares the names of 2 cfc's, these cfc's can be anything. So the trick i did with the iterator does not really work.

There's a few ways to fix this:

- compare the struct of all functions, most of the time this should work, only not in the case where 2 different cfc's have exactly the same functions, but they work differently.
- add a method to every reactor object that returns the class name.

Any other ideas?
Btw, isInstanceOf method seems to work internally with the same data as getMetadata so that wont make anything faster.

greets,
klaas
--
Don't drink and park, accidents cause people

Klaas-Jan Winkel

unread,
May 10, 2010, 8:01:35 AM5/10/10
to reacto...@googlegroups.com
Hi People,
What do you think of commenting this code in reactor.base.abstractTo._isEqual method out:

<cfif getMetadata(this).name IS NOT getMetadata(arguments.To).name>
<cfreturn false />
</cfif>


It's slow. Commeting it out makes reactor around 5-10% faster, somewhere around there.

Because there is a try/catch around comparing the to's it will just return false if the key doesnt exist.

To make it maybe more safe you could let it also compare the methods, by removing:

NOT IsCustomFunction(this[item]) 

Then the methods would act as a signature for the cfc-name.

The only way something would go wrong is when there is a completely different cfc with the same values as the to-cfc, but when does that happen?

greets,
klaas
Reply all
Reply to author
Forward
0 new messages