원클릭으로
go-performance
Optimización de rendimiento en Go. Usar al optimizar hot paths, reducir allocations, o mejorar latencia.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Optimización de rendimiento en Go. Usar al optimizar hot paths, reducir allocations, o mejorar latencia.
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.
Benchmarks y profiling en Go. Usar al medir rendimiento, comparar implementaciones, o identificar bottlenecks.
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.
| name | go-performance |
| description | Optimización de rendimiento en Go. Usar al optimizar hot paths, reducir allocations, o mejorar latencia. |
| allowed-tools | Read, Grep, Glob, Bash(go test -bench:*, go tool pprof:*) |
Optimización de rendimiento en Go.
// ❌ MAL
var results []Result
for _, item := range items {
results = append(results, transform(item))
}
// ✅ BIEN: Pre-allocate
results := make([]Result, 0, len(items))
var bufferPool = sync.Pool{
New: func() interface{} { return new(bytes.Buffer) },
}
func process() {
buf := bufferPool.Get().(*bytes.Buffer)
defer func() { buf.Reset(); bufferPool.Put(buf) }()
// usar buf...
}
type ExpressionCache struct {
mu sync.RWMutex
cache map[string]*Expression
}
func (c *ExpressionCache) GetOrCompile(expr string) (*Expression, error) {
// Fast path: lectura
c.mu.RLock()
if e, ok := c.cache[expr]; ok {
c.mu.RUnlock()
return e, nil
}
c.mu.RUnlock()
// Slow path: compilar y guardar
}
go test -bench=. -benchmem ./...
go test -cpuprofile=cpu.prof -bench=BenchmarkX
go tool pprof cpu.prof