Skip to content

Commit

Permalink
add timings for getCanonicalResourceEL
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer committed Dec 19, 2024
1 parent 9645941 commit 0fd0598
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions core/src/main/java/lucee/runtime/listener/JavaSettingsImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -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<Resource>) 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<Resource> paths = null;
if (mapPath != null) {
Expand Down

0 comments on commit 0fd0598

Please sign in to comment.