Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LDEV-5203 optimize checkPrimaryTypes matching #2460

Open
wants to merge 1 commit into
base: 6.2
Choose a base branch
from

Conversation

zspitzer
Copy link
Member

@zspitzer zspitzer commented Dec 19, 2024

https://luceeserver.atlassian.net/browse/LDEV-5203

with java 11, this speeds up quite quickly, down to 0 or 100ns

     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 4690500
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 100
     [java]    [script] ClassUtil.__loadClass 2:6000
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 72000
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 0
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 27500
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 100
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 22800
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 100
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 17100
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 0
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 19300
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 0
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 25400
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 100
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 26400
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 0
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 21000
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 100
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 22200
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 0
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 21800
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 100
     [java]    [script] ClassUtil.__loadClass 2:259000
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 100
     [java]    [script] ClassUtil.__loadClass 2:145100
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 100
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 0
     [java]    [script] JavaSettingsImpl.getInstance: paths 2100
     [java]    [script] JavaSettingsImpl.getInstance: add res 796600
     [java]    [script] JavaSettingsImpl.getInstance: mapPath 17700
     [java]    [script] JavaSettingsImpl.getInstance: bundles 500
     [java]    [script] JavaSettingsImpl.getInstance: watchExtensions 53000
     [java]    [script] JavaSettingsImpl.getInstance: noJs 17100
     [java]    [script] JavaSettingsImpl.getInstance new JavaSettingsImpl: 28100
     [java]    [script] ModernApplicationContext.getRPCClassLoader: 200
     [java]    [script] ComponentPageImpl.getJavaSettings: getJson 1400
     [java]    [script] ComponentPageImpl.getJavaSettings: skip 290200
     [java]    [script] PhysicalClassLoader.getRPCClassLoader: 652800
     [java]    [script] JavaProxy.getRPCClassLoader: 2671600
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 300
     [java]    [script] ClassUtil.__loadClass 2:7054600
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 7218300
     [java]    [script] JavaProxy.loadClass: 7248400
     [java]    [script]

with java 21 not so much, maybe it takes longer to optimize?

     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 117400
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 1900
     [java]    [script] ClassUtil.__loadClass 2:16300
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 227400
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 600
     [java]    [script] ClassUtil.__loadClass 2:8300
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 112500
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 600
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 55400
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 500
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 50900
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 600
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 53900
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 600
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 55900
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 600
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 58000
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 600
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 54200
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 700
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 59500
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 600
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 49400
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 600
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 46000
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 800
     [java]    [script] ClassUtil.__loadClass 2:321700
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 800
     [java]    [script] ClassUtil.__loadClass 2:232000
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 800
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 600
     [java]    [script] JavaSettingsImpl.getInstance: paths 1600
     [java]    [script] JavaSettingsImpl.getInstance: add res 1639800
     [java]    [script] JavaSettingsImpl.getInstance: mapPath 14700
     [java]    [script] JavaSettingsImpl.getInstance: bundles 400
     [java]    [script] JavaSettingsImpl.getInstance: watchExtensions 39700
     [java]    [script] JavaSettingsImpl.getInstance: noJs 14000
     [java]    [script] JavaSettingsImpl.getInstance new JavaSettingsImpl: 15200
     [java]    [script] ModernApplicationContext.getRPCClassLoader: 300
     [java]    [script] ComponentPageImpl.getJavaSettings: getJson 700
     [java]    [script] ComponentPageImpl.getJavaSettings: skip 346300
     [java]    [script] PhysicalClassLoader.getRPCClassLoader: 715800
     [java]    [script] JavaProxy.getRPCClassLoader: 2817500
     [java]    [script] ClassUtil._loadClass.checkPrimaryTypesBytecodeDef 1000
     [java]    [script] ClassUtil.__loadClass 2:9922500
     [java]    [script] ClassUtil.loadClass..ClassLoaderBasedClassLoading (match): 10086200
     [java]    [script] JavaProxy.loadClass: 10113800
     [java]    [script]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant