* Wrap calls to registerSubstitute() in a single transaction to
improve throughput. * Don't build the `substitute-rev' table for now, since it caused Theta(N^2) time and log file consumption when adding N substitutes. Maybe we can do without it.
This commit is contained in:
		
							parent
							
								
									15c60ca1b6
								
							
						
					
					
						commit
						daf0a923c7
					
				
					 3 changed files with 13 additions and 11 deletions
				
			
		|  | @ -170,6 +170,9 @@ static void opSubstitute(Strings opFlags, Strings opArgs) | |||
|     if (!opArgs.empty()) | ||||
|         throw UsageError("no arguments expected"); | ||||
| 
 | ||||
|     Transaction txn; | ||||
|     createStoreTransaction(txn); | ||||
| 
 | ||||
|     while (1) { | ||||
|         Path srcPath; | ||||
|         Substitute sub; | ||||
|  | @ -188,8 +191,11 @@ static void opSubstitute(Strings opFlags, Strings opArgs) | |||
|             sub.args.push_back(s); | ||||
|         } | ||||
|         if (!cin || cin.eof()) throw Error("missing input"); | ||||
|         registerSubstitute(srcPath, sub); | ||||
|         cerr << "."; | ||||
|         registerSubstitute(txn, srcPath, sub); | ||||
|     } | ||||
| 
 | ||||
|     txn.commit(); | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue