[JBoss JIRA] Created: (SOLDER-69) Solder Messages are *extremely* slow in AnnotatedTypeBuilder, should not be used in such a performance sensitive place
by Lincoln Baxter III (JIRA)
Solder Messages are *extremely* slow in AnnotatedTypeBuilder, should not be used in such a performance sensitive place
----------------------------------------------------------------------------------------------------------------------
Key: SOLDER-69
URL: https://issues.jboss.org/browse/SOLDER-69
Project: Seam Solder
Issue Type: Bug
Components: Reflections
Affects Versions: 3.0.0.Beta2
Reporter: Lincoln Baxter III
Priority: Critical
According to my YourKit profile of Seam Forge bootstrap, the following message bundle lookup is responsible for roughly 80% of boot-up time, just from all the instances of AnnotationBuilder and related classes that solder creates on EVERY Weld bootstrap.
Obviously this could be simply removed and replaced with non-i18n messages, or these messages could be cached and loaded in a more performant manner... IMO, this is going to be a huge problem with messages. JBoss logging is slow, but message bundle lookup is much slower.
The two offenders are the following methods - consider making them static, since this only needs to be done once per JVM:
public class AnnotationBuilder
{
private transient static AnnotatedMessages messages = Messages.getBundle(AnnotatedMessages.class);
...
}
public class AnnotatedTypeBuilder<T>
{
private transient static AnnotatedMessages messages = Messages.getBundle(AnnotatedMessages.class);
...
}
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 5 months
[JBoss JIRA] Updated: (SOLDER-23) Provide utility to extract type parameter from Instance
by Shane Bryzak (JIRA)
[ https://issues.jboss.org/browse/SOLDER-23?page=com.atlassian.jira.plugin.... ]
Shane Bryzak updated SOLDER-23:
-------------------------------
Fix Version/s: 3.0.0.Beta3
(was: 3.0.0.Beta2)
> Provide utility to extract type parameter from Instance
> -------------------------------------------------------
>
> Key: SOLDER-23
> URL: https://issues.jboss.org/browse/SOLDER-23
> Project: Seam Solder
> Issue Type: Feature Request
> Components: Reflections
> Affects Versions: 3.0.0.Beta1
> Reporter: Dan Allen
> Assignee: Dan Allen
> Priority: Minor
> Fix For: 3.0.0.Beta3
>
>
> When discovering injection points, a type of Instance<T> is effectively the same as discovering a type T. You don't want to create a producer method for an Instance, for instance, hence why you want to figure out what T is. Thus, it's common to want to extract the type parameter from Instance. Having a utility would be convenient.
> Here's an example that collects the actual bean types (extracting from the Instance type parameter if necessary)
> Set<Type> types = new HashSet<Type>();
> for (InjectionPoint ip : event.getInjectionTarget().getInjectionPoints())
> {
> types.add(Reflections.getActualType(ip.Type()));
> }
> Here's the utility:
> private static Type getActualType(Type t)
> {
> if (t instanceof ParameterizedType && ((ParameterizedType) t).getRawType().equals(Instance.class))
> {
> return ((ParameterizedType) t).getActualTypeArguments()[0];
> }
> return t;
> }
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 5 months
[JBoss JIRA] Updated: (SOLDER-12) Add isMetadataChanged() accessor to AnnotatedTypeBuilder
by Shane Bryzak (JIRA)
[ https://issues.jboss.org/browse/SOLDER-12?page=com.atlassian.jira.plugin.... ]
Shane Bryzak updated SOLDER-12:
-------------------------------
Fix Version/s: 3.0.0.Beta3
(was: 3.0.0.Beta2)
> Add isMetadataChanged() accessor to AnnotatedTypeBuilder
> --------------------------------------------------------
>
> Key: SOLDER-12
> URL: https://issues.jboss.org/browse/SOLDER-12
> Project: Seam Solder
> Issue Type: Feature Request
> Components: Builders
> Affects Versions: 3.0.0.Beta1
> Reporter: Dan Allen
> Assignee: Dan Allen
> Priority: Minor
> Fix For: 3.0.0.Beta3
>
>
> As an optimization, it makes sense to only create the AnnotatedType and assign it to ProcessAnnotatedType if the metadata has changed in anyway. Otherwise, you are wrapping the type just for the sake of wrapping it.
> Therefore, I propose that any change to the state of the annotated type be tracked by a changed flag that is accessible by calling the AnnotatedTypeBuilder#isMetadataChanged() (or similarly named) method. It would be used as follows:
> AnnotatedTypeBuilder b = AnnotatedTypeBuilder.readFromType(event.getAnnotatedType(), true);
> // do extension logic
> if (b.isMetadataChanged())
> {
> event.setAnnotatedType(b.create());
> }
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
13 years, 5 months