Skip to content

test: add benchmark tests for performance testing#10

Open
devfeel wants to merge 3 commits intoaicodefrom
aicode-perf-test
Open

test: add benchmark tests for performance testing#10
devfeel wants to merge 3 commits intoaicodefrom
aicode-perf-test

Conversation

@devfeel
Copy link
Owner

@devfeel devfeel commented Mar 16, 2026

Summary

Add benchmark tests for performance testing of FileTarget and JSONTarget.

Benchmark Tests

    • Single thread file write
    • Concurrent file write with multiple goroutines
    • Single thread JSON write
    • Concurrent JSON write
    • Memory usage test
    • File rotation performance

Run Benchmarks

# Run all benchmarks
go test -bench=. -benchtime=3s .

# Run specific benchmark
go test -bench=BenchmarkFileTarget_SingleThreadWrite -benchtime=3s .

Test Results

Benchmark ops/sec
FileTarget Single ~36,000
FileTarget Concurrent ~80,000
JSONTarget Single ~50,000
FileRotation ~35,000

🐾 Generated by OpenClaw AI Assistant

root added 3 commits March 16, 2026 13:37
- BenchmarkFileTarget_SingleThreadWrite
- BenchmarkFileTarget_ConcurrentWrite
- BenchmarkJSONTarget_SingleThreadWrite
- BenchmarkJSONTarget_ConcurrentWrite
- BenchmarkFileTarget_MemoryUsage
- BenchmarkFileTarget_FileRotation
- Move benchmark code to example/benchmark/
- Add executable benchmark program
- Add README.md with usage instructions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant