mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 18:57:18 +08:00 
			
		
		
		
	Reduce running time / allocations of frame parser
This commit is contained in:
		| @ -3,6 +3,7 @@ package frame_test | ||||
| import ( | ||||
| 	"testing" | ||||
|  | ||||
| 	"github.com/davecheney/profile" | ||||
| 	"github.com/derekparker/dbg/dwarf/frame" | ||||
| ) | ||||
|  | ||||
| @ -38,3 +39,13 @@ func TestParse(t *testing.T) { | ||||
| 	} | ||||
|  | ||||
| } | ||||
|  | ||||
| func BenchmarkParse(b *testing.B) { | ||||
| 	defer profile.Start(profile.CPUProfile).Stop() | ||||
| 	data := grabDebugFrameSection("../../_fixtures/testprog", nil) | ||||
|  | ||||
| 	b.ResetTimer() | ||||
| 	for i := 0; i < b.N; i++ { | ||||
| 		frame.Parse(data) | ||||
| 	} | ||||
| } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Derek Parker
					Derek Parker