trie: make fullnode children hash calculation concurrently (#15131)
* trie: make fullnode children hash calculation concurrently * trie: thread out only on topmost fullnode * trie: clean up full node children hash calculation * trie: minor code fixups
This commit is contained in:
		
				
					committed by
					
						 Péter Szilágyi
						Péter Szilágyi
					
				
			
			
				
	
			
			
			
						parent
						
							e4c9fd29a3
						
					
				
				
					commit
					0f7fbb85d6
				
			| @@ -199,10 +199,10 @@ func (t *SecureTrie) secKey(key []byte) []byte { | ||||
| // invalid on the next call to hashKey or secKey. | ||||
| func (t *SecureTrie) hashKey(key []byte) []byte { | ||||
| 	h := newHasher(0, 0) | ||||
| 	h.sha.Reset() | ||||
| 	h.sha.Write(key) | ||||
| 	buf := h.sha.Sum(t.hashKeyBuf[:0]) | ||||
| 	returnHasherToPool(h) | ||||
| 	calculator := h.newCalculator() | ||||
| 	calculator.sha.Write(key) | ||||
| 	buf := calculator.sha.Sum(t.hashKeyBuf[:0]) | ||||
| 	h.returnCalculator(calculator) | ||||
| 	return buf | ||||
| } | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user