一键导入
go-benchmarking
Benchmarks y profiling en Go. Usar al medir rendimiento, comparar implementaciones, o identificar bottlenecks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Benchmarks y profiling en Go. Usar al medir rendimiento, comparar implementaciones, o identificar bottlenecks.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Guía para trabajar con StructureDefinitions y ElementDefinitions en FHIR. Usar cuando se necesite entender o manipular definiciones de estructura.
Diseño de arquitectura limpia y modular en Go. Usar al diseñar un nuevo módulo, definir capas y responsabilidades, u organizar código.
Patrones de caching y pooling en Go. Usar al implementar caches, reducir allocations, o cachear resultados costosos.
Revisión de código Go. Usar al revisar PRs, verificar calidad de código, o identificar problemas potenciales.
Composición, embedding y extensibilidad en Go. Usar al extender tipos existentes o combinar comportamientos.
Concurrencia, goroutines y thread-safety en Go. Usar al diseñar código concurrente o manejar recursos compartidos.
| name | go-benchmarking |
| description | Benchmarks y profiling en Go. Usar al medir rendimiento, comparar implementaciones, o identificar bottlenecks. |
| allowed-tools | Read, Grep, Glob, Bash(go test -bench:*, go tool pprof:*, go tool trace:*) |
Benchmarks y profiling de rendimiento en Go.
func BenchmarkCompile(b *testing.B) {
for i := 0; i < b.N; i++ {
_, _ = fhirpath.Compile("Patient.name.given")
}
}
func BenchmarkEvaluate(b *testing.B) {
expr := fhirpath.MustCompile("Patient.name.given")
b.ResetTimer() // No contar setup
for i := 0; i < b.N; i++ {
_, _ = expr.Evaluate(patientJSON)
}
}
# Todos los benchmarks
go test -bench=. -benchmem ./...
# Benchmark específico
go test -bench=BenchmarkValidate ./validator
# Con CPU profile
go test -bench=BenchmarkX -cpuprofile=cpu.prof
go tool pprof cpu.prof
# Con memory profile
go test -bench=BenchmarkX -memprofile=mem.prof
go tool pprof mem.prof
BenchmarkCompile-8 50000 30123 ns/op 12048 B/op 234 allocs/op
│ │ │ │
│ │ │ └─ Allocations por op
│ │ └─ Bytes por op
│ └─ Nanosegundos por op
└─ Número de iteraciones