mirror of
				https://github.com/golang/go.git
				synced 2025-10-31 16:50:58 +00:00 
			
		
		
		
	net: ensure identical queries are not sent multiple times in builtin stub resolver
Prevents non-rooted queries with > ndots dots from being tried twice on error. Fixes #8616. Benchmark results on linux/amd64 benchmark old ns/op new ns/op delta BenchmarkGoLookupIPNoSuchHost 8212394 4413293 -46.26% benchmark old allocs new allocs delta BenchmarkGoLookupIPNoSuchHost 216 108 -50.00% benchmark old bytes new bytes delta BenchmarkGoLookupIPNoSuchHost 17460 8726 -50.02% LGTM=iant, mikioh.mikioh R=golang-codereviews, iant, mikioh.mikioh CC=golang-codereviews https://golang.org/cl/137870043
This commit is contained in:
		
							parent
							
								
									858c57f5bd
								
							
						
					
					
						commit
						854dbb7fdc
					
				
					 2 changed files with 15 additions and 12 deletions
				
			
		|  | @ -217,3 +217,9 @@ func TestReloadResolvConfChange(t *testing.T) { | |||
| 	r.SetConf("nameserver 8.8.4.4") | ||||
| 	r.WantServers([]string{"[8.8.4.4]"}) | ||||
| } | ||||
| 
 | ||||
| func BenchmarkGoLookupIPNoSuchHost(b *testing.B) { | ||||
| 	for i := 0; i < b.N; i++ { | ||||
| 		goLookupIP("some.nonexistent") | ||||
| 	} | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Alex A Skinner
						Alex A Skinner