# HG changeset patch # User dadubrow # Date 1245081607 18000 # Node ID 355219af61393b28a3e85abe478f4fdbe54504fd # Parent ecdc976d1827fef0a3b2952e3d5b2c53715ae64c Don't get hrh file timestamps more than once per second diff -r ecdc976d1827 -r 355219af6139 core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContext.java --- a/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContext.java Mon Jun 15 08:24:11 2009 -0500 +++ b/core/com.nokia.carbide.cpp.sdk.core/src/com/nokia/carbide/cpp/internal/api/sdk/SymbianBuildContext.java Mon Jun 15 11:00:07 2009 -0500 @@ -42,6 +42,10 @@ // a copy of bad SDK default to fall back private static ISymbianSDK fallbackForBadSdk = SymbianMissingSDKFactory.createInstance("dummy_ID"); //$NON-NLS-1$ + // last time we checked the hrh file mod dates - only check if changed in last second + private static final long HRH_TIMESTAMP_CHECK_QUANTUM = 1000; // 1 sec + private static long lastHrhTimestampCheck; + private File prefixFileParsed; private List hrhFilesParsed = new ArrayList(); private List variantHRHMacros = new ArrayList(); @@ -353,13 +357,15 @@ } // now check to see if any of the included hrh files have changed - if (!buildCache) { + // we will do this at most once per quantum, because it is expensive and during import it was done 100 times per second + if (!buildCache && (System.currentTimeMillis() - lastHrhTimestampCheck) > HRH_TIMESTAMP_CHECK_QUANTUM) { for (File file : hrhFilesParsed) { if (file.lastModified() > hrhCacheTimestamp) { buildCache = true; break; } } + lastHrhTimestampCheck = System.currentTimeMillis(); } }