Performance hostpot in FieldInterceptionHelper.JavassistDelegate.isInstrumented(Class)
Description
Attachments
is followed up by
relates to
Activity

Brett Meyer March 7, 2014 at 10:09 PM
Bulk closing tickets resolved in released versions
Steve Ebersole December 27, 2011 at 11:15 PM
Another (probably better) option would be to expose something like org.hibernate.bytecode.instrumentation.internal.FieldInterceptionHelper.Delegate
from org.hibernate.tuple.entity.EntityTuplizer
/org.hibernate.persister.entity.EntityPersister
, but have it be (1) BytecodeProvider-specific and (2) class-specific. Something like:
EntityFieldInterceptionDelegate.java
BytecodeProvider.java
etc...
Steve Ebersole December 27, 2011 at 10:40 PM
For example, I see this changeset includes a change to org.hibernate.event.internal.AbstractSaveEventListener#markInterceptorDirty
(https://fisheye2.atlassian.com/viewrep/Hibernate-Core/hibernate-core/src/main/java/org/hibernate/event/internal/AbstractSaveEventListener.java?r1=babeacefb0860fa7a04de5bb78700bb109421850&r2=aef27fec4116d6532aebdf1fefdbe89d2f208d38)
which changes:
to:
but why not just change that to:
I have not looked through all the changes, but I cannot imagine there is a time where you have access to this service but do not have access to the EntityPersister
especially since the change here states that use of this service is expected only from a SessionFactory
Steve Ebersole December 27, 2011 at 10:32 PM
Hmm, I think this issue might have been easier to fix than what was done here unless I am misunderstanding something.
Why not just delegate to org.hibernate.persister.entity.EntityPersister#isInstrumented
? Seems you are duplicating that information here in this org.hibernate.service.instrumentation.internal.CachingInstrumentationService#isInstrumentedCache
cache.
The method
is invoked frequently at runtime, creating a significant performance bottleneck; I'm attaching the profiling report from a synthetic micro benchmark which is unlikely to be representative of a real world case, but able to show a waste of 27% of CPU time in this method only.
From previous discussion: