Noticed in windows, with tomee and jsf in DEVELOPMENT stage. When JSF is in DEVELOPMENT mode, every facelet file is refreshed on every access. This is very slow in windows, as you can see in this thread: https://www.mail-archive.com/users@tomee.apache.org/msg17957.html . (we had the same problem but never reported) The problem is that DirResourcesSet is checking constantly this canonicalPath. The problem is solved by setting allowLinking=true in context.xml. One obvious workaround is to avoid checking two times the same getCanonicalPath in: if (entry.getCanonicalPath().length() >= f.getCanonicalPath().length()) { canPath = entry.getCanonicalPath().substring(f.getCanonicalPath().length()); This way time would be halved. Another option is maybe to document the problem or produce a log warning if windows, jsf in development mode and allowLinking=false? I'm unable to provide a simple reproducer as it requires tomcat with jsf and a xhtml with some includes/custom components/tag handlers.
I'm the one initially started the thread in the tomee mailing list. Just some additional infos from me: To see some benchmark figures of how big the impact can be on a windows system, please take a look into this mail from the mentioned thread: https://www.mail-archive.com/users@tomee.apache.org/msg17986.html The impact is really that bad, that it renders the JSF DEVELOPMENT mode unusable, at least with big views. If there are no other options to solve this issue, at least a warning somewhere would be really beneficial, because it is hard for a user to understand why it is so slow and that it can be worked around with allowLinking="true" I've checked many revisions of tomee and found out that this behaviour was starting with the change from tomcat 9.0.48 to 9.0.50
These checks are needed, feel free to post on the user mailing list for further help. Ok for optimizing https://github.com/apache/tomcat/commit/de69069ae4c847165a9f68754faf02dbc106b21d but it is a very recent commit.
The optimization will be in 11.0.0-M14, 10.1.16, 9.0.83 and 8.5.96.