adium 4226:96b7e3762d88: Tune the number of concurrent log text ...

commits at adium.im commits at adium.im
Sat Oct 8 23:07:26 UTC 2011


details:	http://hg.adium.im/adium/rev/96b7e3762d88
revision:	4226:96b7e3762d88
branch:		(none)
author:		Stephen Holt <sholt at adium.im>
date:		Sat Oct 08 12:46:55 2011 -0700

Tune the number of concurrent log text parsing blocks
Subject: adium 4227:5585105af076: Compact the log index after each flush. It can grow to be quite big

details:	http://hg.adium.im/adium/rev/5585105af076
revision:	4227:5585105af076
branch:		(none)
author:		Stephen Holt <sholt at adium.im>
date:		Sat Oct 08 12:48:03 2011 -0700

Compact the log index after each flush. It can grow to be quite big

diffs (40 lines):

diff -r 83cf5cf606e5 -r 5585105af076 Source/AILoggerPlugin.m
--- a/Source/AILoggerPlugin.m	Sat Oct 08 22:51:42 2011 +0200
+++ b/Source/AILoggerPlugin.m	Sat Oct 08 12:48:03 2011 -0700
@@ -209,7 +209,7 @@
 	self.activeAppenders = [NSMutableDictionary dictionary];
 	self.dirtyLogSet = [NSMutableSet set];
 	
-	defaultDispatchQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0);
+	defaultDispatchQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0);
 	
 	dirtyLogSetMutationQueue = dispatch_queue_create("im.adium.AILoggerPlugin.dirtyLogSetMutationQueue", 0);
 	searchIndexQueue = dispatch_queue_create("im.adium.AILoggerPlugin.searchIndexFlushingQueue", 0);
@@ -224,8 +224,8 @@
 	ioQueue = dispatch_queue_create("im.adium.AILoggerPlugin.ioQueue", 0);
 	
 	NSUInteger cpuCount = [[NSProcessInfo processInfo] activeProcessorCount];	
-	jobSemaphore = dispatch_semaphore_create(cpuCount + AIfloor(cpuCount/2));
-    logLoadingPrefetchSemaphore = dispatch_semaphore_create(2); //prefetch one log
+	jobSemaphore = dispatch_semaphore_create(3 * cpuCount);
+    logLoadingPrefetchSemaphore = dispatch_semaphore_create(3 * cpuCount + 1); //prefetch one log
 	
 	
 	self.xhtmlDecoder = [[AIHTMLDecoder alloc] initWithHeaders:NO
@@ -469,7 +469,7 @@
 											  (CFStringRef)@"Content", 
 											  kSKIndexInverted,
 											  (CFDictionaryRef)textAnalysisProperties);
-				
+
 				if (_index) {
 					AILogWithSignature(@"Created a new log index %x at %@ with textAnalysisProperties %@. Will reindex all logs.",_index,logIndexURL,textAnalysisProperties);
 					//Clear the dirty log set in case it was loaded (this can happen if the user mucks with the cache directory)
@@ -1645,6 +1645,7 @@
 		AILogWithSignature(@"**** Flushing index %p",inIndex);
 		CFRetain(inIndex);
 		SKIndexFlush(inIndex);
+		SKIndexCompact(inIndex);
 		CFRelease(inIndex);
 		AILogWithSignature(@"**** Finished flushing index %p, and released it",inIndex);
 		self.indexIsFlushing = NO;




More information about the commits mailing list