Darius, I don't see any extra AOP time spent using LogicService instead of TokenService. However, I agree it would be a good idea to use the TokenService instead in our Arden translation code. I can open a ticket for this and make the change.
Most of the time retrieving the token registrations is spent in the Hibernate query area. I can definitely try out your suggestion of checking the cache for the Rule before retrieving the token registration information. I can open the ticket and make the change for this as well. Name Time (ms) Own Time (ms) $Proxy129.getTokenRegistrations(String, RuleProvider, String, String) 773 31 org.openmrs.logic.token.db.hibernate.HibernateTokenDAO.getTokenRegistrations(String, RuleProvider, String, String) 710 0 org.hibernate.persister.entity.AbstractEntityPersister.getTuplizer(EntityMode) 93 0 org.hibernate.tuple.entity.EntityMetamodel.getTuplizer(EntityMode) 93 0 org.hibernate.tuple.EntityModeToTuplizerMapping.getTuplizer(EntityMode) 93 0 org.hibernate.tuple.EntityModeToTuplizerMapping.getTuplizerOrNull(EntityMode) 93 0 org.hibernate.property.DirectPropertyAccessor$DirectGetter.get(Object) 78 0 com.mysql.jdbc.Field.getTableName() 31 0 Thanks, Steve From: [email protected] [mailto:[email protected]] On Behalf Of Darius Jazayeri Sent: Friday, October 07, 2011 2:05 PM To: McKee, Steven Jay Cc: [email protected]; Dugan, Tammy Marie; dev Subject: Re: Token Registration Hi Steve, You should get some instant speedup if you call TokenService.getRule instead of LogicService.getRule. (The latter delegates to the former, and pays the AOP overhead twice.) Is the 2 seconds in actual SQL, or is it part of AOP overhead? Rules are actually cached by token, it's just that we're fetching the TokenConfiguration before checking the cache. I don't see any reason we can't check the cache first. (Peeking at the code it seems like there would be no side-effects of doing this.) Can you try this out and create a ticket/patch for it? -Darius On Friday, October 7, 2011, McKee, Steven Jay wrote: Darius, We've been doing some performance testing for CHICA getting ready for our production install of OpenMRS 1.7, and we've noticed some slow performance in retrieving token registrations. We run a high volume of rules throughout the day, so we're calling the getRule(String) method quite often. Each time this is called, it makes a request to the database for the TokenRegistration object. Do you think it's possible that we could cache the objects so we don't have to constantly hit the database? It takes about 8-10 seconds to produce one of our forms, and about 2 seconds of that time is spent retrieving the token registrations. Thanks, Steve McKee Children's Health Services Research Indiana University School of Medicine Phone: 317-278-9660<tel:317-278-9660> Email: [email protected]<javascript:_e(%7b%7d,%20'cvml',%20'[email protected]');> _________________________________________ To unsubscribe from OpenMRS Developers' mailing list, send an e-mail to [email protected] with "SIGNOFF openmrs-devel-l" in the body (not the subject) of your e-mail. [mailto:[email protected]?body=SIGNOFF%20openmrs-devel-l]

