Hi,

today i did a first try on TomEE8 and i really wondered about the slow
startup, with even 1 application:

TomEE8:
OpenWebBeans Container has started, it took 9356 ms

TomEE7:
OpenWebBeans Container has started, it took 4287 ms

i found out that ~3 seconds are taken by
BValExtension#processAnnotatedType, but i also know that BVal 2 probably
requires to build metadata for each bean, so a overhead is expected.

A good, first, performance boost would be to enhance the
BValExtension#DEFAULT_ANNOTATED_TYPE_FILTER:

    private static final AnnotatedTypeFilter DEFAULT_ANNOTATED_TYPE_FILTER =
        (AnnotatedType<?> annotatedType) -> {
            String className = annotatedType.getJavaClass().getName();
            return !className.startsWith("org.apache.bval.")
                    && !className.startsWith("org.apache.deltaspike.")
                    && !className.startsWith("org.apache.openejb.")
                    && !className.startsWith("org.apache.myfaces.");
    };

This reduces the startup time by 2 seconds to:
OpenWebBeans Container has started, it took 7750 ms.

WDYT?

Best regards,
Thomas

Reply via email to