Community

JBoss Reflect Performance Javassist vs Introspection

reply from Flavia Rainone in JBoss Microcontainer Development - View the full discussion

Kabir Khan wrote:

 

The question is what differentiator to use? A few ideas:

  • Keep a counter in Javassist[Method/Field/Constructor]Info and once it has been called several times switch to the generated class. The problem with this is, what if this counter kicks in and we end up generating the class and then we don't have enough subsequent accesses to reap the performance benefits, i.e. in this case it would slow it down.
  • Use some annotation to say that for a particular class we should always use generated members. If this annotation comes from MC BeanMetaData it could be put into the TypeInfo attachments.

I vote for using a combination of those two diferentiators.

Reply to this message by going to Community

Start a new discussion in JBoss Microcontainer Development at Community