MCPcopy Create free account
hub / github.com/astercloud/aster / BenchmarkMiddlewareStack

Function BenchmarkMiddlewareStack

pkg/middleware/integration_test.go:238–248  ·  view source on GitHub ↗

BenchmarkMiddlewareStack 性能测试: Middleware Stack

(b *testing.B)

Source from the content-addressed store, hash-verified

236
237// BenchmarkMiddlewareStack 性能测试: Middleware Stack
238func BenchmarkMiddlewareStack(b *testing.B) {
239 backend := backends.NewStateBackend()
240 middleware := NewFilesystemMiddleware(&FilesystemMiddlewareConfig{
241 Backend: backend,
242 })
243 stack := NewStack([]Middleware{middleware})
244
245 for b.Loop() {
246 _ = stack.Tools()
247 }
248}
249
250// BenchmarkBackendWrite 性能测试: Backend Write
251func BenchmarkBackendWrite(b *testing.B) {

Callers

nothing calls this directly

Calls 4

ToolsMethod · 0.95
NewStateBackendFunction · 0.92
NewFilesystemMiddlewareFunction · 0.85
NewStackFunction · 0.85

Tested by

no test coverage detected