0841e03a4c498b12568f859596a0b83b4b1bb6ef
				
			
			
		
	 John Goerzen
		
	
	0841e03a4c
	
	
	[319117] Unroll loop to speed performance on large folders
			John Goerzen
		
	
	0841e03a4c
	
	
	[319117] Unroll loop to speed performance on large folders
		
			
			From: "Nikita V. Youshchenko" I trued to use offlineimap and found that while being quite fast on small folders, it takes up to several minutes (of 100% busy CPU and almost no network traffic) to sync a folder with 2000+ messages. While looking into the code, I found why this happens. In folder/Base.py, in method BaseFolder.syncmessagesto_copy(), dest.getmessagelist() is called inside a loop, while being a loop invariant. Similar thing happens in BaseFolder.syncmessagesto_delete() for self.getmessagelist(). This causes quadratic complexity over folder size. Moving these calls out of loops make large folder sync fast (several seconds instead of several minutes for folder with 2000 messages on 700MHz P3).
OfflineIMAP Copyright (C) 2002, 2003 John Goerzen <jgoerzen@complete.org> This software comes with ABSOLUTELY NO WARRANTY; see the file COPYING for details. This is free software, and you are welcome to distribute it under the conditions laid out in COPYING. gopher://quux.org/1/devel/offlineimap http://quux.org/devel/offlineimap Please see manual.txt; the information previously in README has been moved there.
Description
				
					Languages
				
				
								
								
									Python
								
								97.1%
							
						
							
								
								
									Shell
								
								2.3%
							
						
							
								
								
									Makefile
								
								0.4%
							
						
							
								
								
									Dockerfile
								
								0.2%