Exemple #1
0
func benchmark(b *testing.B, fn func(b *testing.B, mnt string), conf *benchConfig) {
	srv := &fs.Server{
		FS: benchFS{
			conf: conf,
		},
	}
	mnt, err := fstestutil.Mounted(srv)
	if err != nil {
		b.Fatal(err)
	}
	defer mnt.Close()

	fn(b, mnt.Dir)
}
Exemple #2
0
func benchmark(b *testing.B, fn func(b *testing.B, mnt string), conf *benchConfig) {
	filesys := benchFS{
		conf: conf,
	}
	mnt, err := fstestutil.Mounted(filesys, nil,
		fuse.MaxReadahead(64*1024*1024),
		fuse.AsyncRead(),
		fuse.WritebackCache(),
	)
	if err != nil {
		b.Fatal(err)
	}
	defer mnt.Close()

	fn(b, mnt.Dir)
}