RFR: JDK-8189861: Refactor CacheFind

Erik Joelsson erik.joelsson at oracle.com
Mon Apr 1 19:22:50 UTC 2019


The macro CacheFind is a bit awkward to use with FillCacheFind. The 
naming is also not that great. This patch tries to improve this 
situation. The main difference is naming of the macros. Now the main 
entry point is "FindFiles". There are a couple of others as well, see 
MakeBase.gmk for details. Another notable difference is that 
FillCacheFind is now called FillFindCache and should not be called with 
$(eval) anymore.

As an alternative to running $(shell find ...), I have implemented a 
recursive macro using $(wildcard ...) that mimics the basic FindFiles 
functionality. I have found that on Windows/Cygwin, it's generally a bit 
faster than spawning external processes. With this change, the default 
FindFiles will use the wildcard find macro on Windows.

My initial idea for this patch was to essentially get rid of 
FillFindCache and have FindFiles add everything to the cache 
automatically. Unfortunately, that did not do anything to improve 
performance as in the large majority of cases, we do not reuse find 
results. I think it's better to explicitly cache things in the few 
locations where it actually helps.

I have added a decent set of tests in TestMakeBase.gmk that verifies the 
functionality of the new macros.

Bug: https://bugs.openjdk.java.net/browse/JDK-8189861 
<https://bugs.openjdk.java.net/browse/JDK-8189861?filter=-1>

Webrev: http://cr.openjdk.java.net/~erikj/8189861/webrev.01/index.html

/Erik



More information about the build-dev mailing list