Skip to content

Instantly share code, notes, and snippets.

@philwebb
Created Jun 12, 2018
Embed
What would you like to do?
public class TimeMe2 {
private static final String[] NAMES = { "java.lang.annotation.Target",
"java.lang.annotation.Retention", "java.lang.annotation.Documented",
"org.springframework.stereotype.Indexed", "java.lang.annotation.Target",
"java.lang.annotation.Retention", "java.lang.annotation.Documented",
"org.springframework.stereotype.Controller",
"org.springframework.web.bind.annotation.GetMapping",
"org.springframework.web.bind.annotation.ResponseBody",
"java.lang.annotation.Target", "java.lang.annotation.Retention",
"java.lang.annotation.Documented", "org.springframework.stereotype.Component",
"org.springframework.core.annotation.AliasFor",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.boot.autoconfigure.AutoConfigureOrder",
"org.springframework.context.annotation.Conditional",
"org.springframework.boot.context.properties.EnableConfigurationProperties",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.context.properties.ConfigurationProperties",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.AutoConfigureOrder",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"java.lang.annotation.Target", "java.lang.annotation.Retention",
"java.lang.annotation.Documented", "org.springframework.stereotype.Component",
"org.springframework.core.annotation.AliasFor",
"java.lang.annotation.Retention", "java.lang.annotation.Target",
"java.lang.annotation.Documented",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication",
"org.springframework.boot.autoconfigure.AutoConfigureBefore",
"org.springframework.boot.autoconfigure.AutoConfigureOrder",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication",
"org.springframework.boot.context.properties.EnableConfigurationProperties",
"org.springframework.context.annotation.Import",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication",
"org.springframework.boot.autoconfigure.AutoConfigureBefore",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"java.lang.annotation.Target", "java.lang.annotation.Retention",
"java.lang.annotation.Documented",
"org.springframework.context.annotation.Conditional",
"java.lang.annotation.Target", "java.lang.annotation.Retention",
"java.lang.annotation.Documented", "java.lang.annotation.Target",
"java.lang.annotation.Retention", "java.lang.annotation.Documented",
"org.springframework.context.annotation.Conditional",
"java.lang.annotation.Retention", "java.lang.annotation.Target",
"java.lang.annotation.Documented",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.AutoConfigureOrder",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication",
"org.springframework.boot.context.properties.EnableConfigurationProperties",
"org.springframework.context.annotation.Import",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"java.lang.annotation.Target", "java.lang.annotation.Retention",
"java.lang.annotation.Documented",
"org.springframework.context.annotation.Import",
"java.lang.annotation.Target", "java.lang.annotation.Retention",
"java.lang.annotation.Documented",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean", "java.lang.annotation.Target",
"java.lang.annotation.Retention", "java.lang.annotation.Documented",
"org.springframework.context.annotation.Conditional",
"org.springframework.boot.autoconfigure.AutoConfigureOrder",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.AutoConfigureAfter",
"org.springframework.core.annotation.Order",
"org.springframework.core.annotation.Order",
"org.springframework.context.annotation.Configuration",
"org.springframework.context.annotation.Conditional",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.context.properties.EnableConfigurationProperties",
"org.springframework.context.annotation.Import",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnBean",
"org.springframework.context.annotation.Configuration",
"org.springframework.context.annotation.Conditional",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.context.properties.EnableConfigurationProperties",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnBean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean",
"java.lang.annotation.Retention", "java.lang.annotation.Target",
"java.lang.annotation.Documented",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.AutoConfigureBefore",
"org.springframework.boot.context.properties.EnableConfigurationProperties",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnProperty",
"org.springframework.context.annotation.Conditional",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Configuration",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnBean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"java.lang.annotation.Retention", "java.lang.annotation.Target",
"java.lang.annotation.Documented",
"org.springframework.context.annotation.Conditional",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.boot.autoconfigure.AutoConfigureOrder",
"org.springframework.boot.autoconfigure.AutoConfigureAfter",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnProperty",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.web.ConditionalOnEnabledResourceChain",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Primary",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.context.annotation.Import",
"org.springframework.boot.context.properties.EnableConfigurationProperties",
"org.springframework.core.annotation.Order",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnBean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnBean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnProperty",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnProperty",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"java.lang.annotation.Retention", "java.lang.annotation.Target",
"java.lang.annotation.Documented",
"org.springframework.context.annotation.Configuration",
"org.springframework.beans.factory.annotation.Autowired",
"org.springframework.lang.Nullable", "org.springframework.lang.Nullable",
"org.springframework.lang.Nullable", "org.springframework.lang.Nullable",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.lang.Nullable",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.lang.Nullable",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Lazy",
"org.springframework.lang.Nullable", "org.springframework.lang.Nullable",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnProperty",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Primary",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.AutoConfigureAfter",
"org.springframework.boot.autoconfigure.condition.ConditionalOnProperty",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnBean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.boot.context.properties.EnableConfigurationProperties",
"org.springframework.boot.autoconfigure.AutoConfigureBefore",
"org.springframework.boot.autoconfigure.AutoConfigureAfter",
"org.springframework.context.annotation.Import",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnBean",
"java.lang.annotation.Target", "java.lang.annotation.Retention",
"java.lang.annotation.Documented",
"org.springframework.context.annotation.Conditional",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnBean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Conditional",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Conditional",
"org.springframework.context.annotation.Import",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Conditional",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Conditional",
"org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Conditional",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate",
"org.springframework.context.annotation.Conditional",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.AutoConfigureAfter",
"org.springframework.boot.autoconfigure.condition.ConditionalOnBean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Conditional",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Conditional",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Conditional",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Conditional",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.context.properties.EnableConfigurationProperties",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.AutoConfigureAfter",
"org.springframework.context.annotation.Import",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.context.properties.EnableConfigurationProperties",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Configuration",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnBean",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnBean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnProperty",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.AutoConfigureAfter",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnBean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.context.properties.EnableConfigurationProperties",
"org.springframework.context.annotation.Conditional",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnResource",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.AutoConfigureAfter",
"org.springframework.boot.autoconfigure.condition.ConditionalOnProperty",
"org.springframework.boot.autoconfigure.condition.ConditionalOnSingleCandidate",
"javax.annotation.PostConstruct",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.context.properties.EnableConfigurationProperties",
"org.springframework.context.annotation.Import",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.AutoConfigureAfter",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.context.properties.EnableConfigurationProperties",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.context.properties.EnableConfigurationProperties",
"org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnProperty",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean",
"org.springframework.context.annotation.Configuration",
"org.springframework.boot.autoconfigure.condition.ConditionalOnClass",
"org.springframework.boot.autoconfigure.condition.ConditionalOnProperty",
"org.springframework.boot.autoconfigure.condition.ConditionalOnWebApplication",
"org.springframework.boot.context.properties.EnableConfigurationProperties",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.context.annotation.Bean",
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean" };
public static void main(String[] args) throws ClassNotFoundException {
LogFactory.getLog(TimeMe2.class);
System.err.println(NAMES.length);
long t = System.nanoTime();
for (String name : NAMES) {
AnnotationUtils.getAnnotations(Class.forName(name));
}
System.err.println(TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - t));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment