From 0fd0598253fae0d0cc3882f1aa8664a208b8b5dd Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Thu, 19 Dec 2024 22:16:19 +0100 Subject: [PATCH] add timings for getCanonicalResourceEL --- .../runtime/listener/JavaSettingsImpl.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core/src/main/java/lucee/runtime/listener/JavaSettingsImpl.java b/core/src/main/java/lucee/runtime/listener/JavaSettingsImpl.java index af1f5a4f55..a350c3c40e 100644 --- a/core/src/main/java/lucee/runtime/listener/JavaSettingsImpl.java +++ b/core/src/main/java/lucee/runtime/listener/JavaSettingsImpl.java @@ -458,19 +458,36 @@ public static JavaSettings getInstance(Config config, Struct data, Object addion // addional resources if (addionalResources != null) { + lucee.aprint.o(addionalResources); if (mapPath == null) mapPath = new HashMap<>(); + Stopwatch stopwatch2 = new Stopwatch(Stopwatch.UNIT_NANO); + if (addionalResources instanceof Resource[]) { for (Resource r: (Resource[]) addionalResources) { + stopwatch2.start(); r = ResourceUtil.getCanonicalResourceEL(r); + lucee.aprint.o("JavaSettingsImpl.getInstance: res.getCanonicalResourceEL " + stopwatch2.time()); + + stopwatch2.start(); mapPath.put("paths:" + r.getAbsolutePath(), r); + lucee.aprint.o("JavaSettingsImpl.getInstance: res.getAbsolutePath " + stopwatch2.time()); + } } else if (addionalResources instanceof List) { for (Resource r: (List) addionalResources) { + + stopwatch2.start(); r = ResourceUtil.getCanonicalResourceEL(r); + lucee.aprint.o("JavaSettingsImpl.getInstance: list.getCanonicalResourceEL " + stopwatch2.time()); + + stopwatch2.start(); mapPath.put("paths:" + r.getAbsolutePath(), r); + lucee.aprint.o("JavaSettingsImpl.getInstance: list.getAbsolutePath " + stopwatch2.time()); + } } + lucee.aprint.o(mapPath); } Collection paths = null; if (mapPath != null) {