From cafa34ca0878175f8c8ab1bf7fcfaba70c2b1368 Mon Sep 17 00:00:00 2001 From: "Jesse N. Glick" Date: Wed, 3 Oct 2007 23:44:10 +0000 Subject: [PATCH] Various microoptimizations to reduce I/O load of common tasks, esp. no-op and . Many inner loops altered to make just 1-2 system calls rather than 4-5. You can easily see how wasteful the previous code was, and find the culprits, by patching r/o java.io.File methods and adding to -Xbootclasspath/p (or use AspectJ). E.g.: public boolean isDirectory() { System.err.println("isDirectory: " + this); if (Math.random() < .01) Thread.dumpStack(); // as before... } Ant still makes an order of magnitude more system calls to do what seem like simple operations than you would think necessary, but this patch should at least improve the situation. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@581748 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 4 ++ .../apache/tools/ant/DirectoryScanner.java | 60 ++++++++++--------- .../org/apache/tools/ant/taskdefs/Rmic.java | 12 +++- .../ant/taskdefs/optional/depend/Depend.java | 18 +++--- .../ant/types/selectors/SelectorUtils.java | 12 ++-- .../apache/tools/ant/util/ResourceUtils.java | 27 ++++----- .../tools/ant/util/SourceFileScanner.java | 9 ++- 7 files changed, 80 insertions(+), 62 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index 5d8c24796..e947a0f61 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -196,6 +196,10 @@ Fixed bugs: Other changes: -------------- + +* Various small optimizations speed up common tasks such as on large + filesets, reducing both I/O and CPU usage. + * Profiling logger has been added with basic profiling capabilities. *