We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
*PartitionWriter.WriteProfileSymbols
1 parent 1c81971 commit 4ff94eeCopy full SHA for 4ff94ee
pkg/phlaredb/symdb/symdb_test.go
@@ -227,3 +227,23 @@ func TestWritePartition(t *testing.T) {
227
`
228
require.Equal(t, expected, resolved.String())
229
}
230
+
231
+func BenchmarkPartitionWriter_WriteProfileSymbols(b *testing.B) {
232
+ b.ReportAllocs()
233
234
+ for i := 0; i < b.N; i++ {
235
+ // If opening the profile or creating the config, db, or
236
+ // partition writer outside the loop it always results in a
237
+ // panic.
238
+ b.StopTimer()
239
+ p, err := pprof.OpenFile("testdata/profile.pb.gz")
240
+ require.NoError(b, err)
241
+ p.Normalize()
242
+ cfg := DefaultConfig().WithDirectory(b.TempDir())
243
+ db := NewSymDB(cfg)
244
+ pw := db.PartitionWriter(0)
245
+ b.StartTimer()
246
247
+ pw.WriteProfileSymbols(p.Profile)
248
+ }
249
+}
0 commit comments