Performance-specific guidelines apply only to the hot path. Don't prematurely optimize—focus these patterns where they matter most.
Works with
AI-first code editor with Composer
Before installing skills in Cursor, ensure your development environment meets these requirements:
node --versiongo-performanceExecute the skills CLI command in your project's root directory to begin installation:
Fetches go-performance from cxuu/golang-skills and configures it for Cursor.
The CLI shows a list of agents. Use arrow keys and space to select Cursor:
Confirm successful installation by checking the skill directory location:
Restart Cursor to activate go-performance. Access via /go-performance in your agent's command palette.
We perform automated surface-level scans (Gen AI Scanner, Socket, Snyk) during installation. These checks detect common vulnerabilities but do not guarantee complete security. Always review skill source code and verify the publisher's reputation before production use.
Skills execute code in your environment. Always review source, verify the publisher, and test in isolation before production.
Submit your Claude Code skill and start earning
Automate repetitive workflows and reduce manual effort
Example
Generate reports, summarize documents, draft communications
Save 3-5 hours per week on routine tasks
Learn new skills, understand complex topics, get expert guidance
Example
Explain concepts, provide examples, suggest learning resources
Accelerate learning and skill development by 2x
Enhance output quality through reviews, suggestions, and refinements
Example
Review drafts, suggest improvements, catch errors
Improve work quality by 30-40% with less effort
0
total installs
0
this week
65
GitHub stars
0
upvotes
Run in your terminal
0
installs
0
this week
65
stars
scripts/bench-compare.sh — Runs Go benchmarks N times with optional baseline comparison via benchstat. Supports saving results for future comparison. Run bash scripts/bench-compare.sh --help for options.Performance-specific guidelines apply only to the hot path. Don't prematurely optimize—focus these patterns where they matter most.
When converting primitives to/from strings, strconv is faster than fmt:
s := strconv.Itoa(rand.Int()) // ~2x faster than fmt.Sprint()
| Approach | Speed | Allocations |
|---|---|---|
fmt.Sprint |
143 ns/op | 2 allocs/op |
strconv.Itoa |
64.2 ns/op | 1 allocs/op |
Read references/STRING-OPTIMIZATION.md when choosing between strconv and fmt for type conversions, or for the full conversion table.
Convert a fixed string to []byte once outside the loop:
data := []byte("Hello world")
for i := 0; i < b.N; i++ {
w.Write(data) // ~7x faster than []byte("...") each iteration
}
Read references/STRING-OPTIMIZATION.md when optimizing repeated byte conversions in hot loops.
Specify container capacity where possible to allocate memory up front. This minimizes subsequent allocations from copying and resizing as elements are added.
Provide capacity hints when initializing maps with make():
m := make(map[string]os.DirEntry, len(files))
Note: Unlike slices, map capacity hints do not guarantee complete preemptive allocation—they approximate the number of hashmap buckets required.
Provide capacity hints when initializing slices with make(), particularly when appending:
data := make([]int, 0, size)
Unlike maps, slice capacity is not a hint—the compiler allocates exactly that much memory. Subsequent append() operations incur zero allocations until capacity is reached.
| Approach | Time (100M iterations) |
|---|---|
| No capacity | 2.48s |
| With capacity | 0.21s |
The capacity version is ~12x faster due to zero reallocations during append.
Don't pass pointers as function arguments just to save a few bytes. If a function refers to its argument x only as *x throughout, then the argument shouldn't be a pointer.
func process(s string) { // not *string — strings are small fixed-size headers
fmt.Println(s)
}
Common pass-by-value types: string, io.Reader, small structs.
Exceptions:
Choose the right strategy based on complexity:
| Method | Best For |
|---|---|
+ |
Few strings, simple concat |
fmt.Sprintf |
Formatted output with mixed types |
strings.Builder |
Loop/piecemeal construction |
strings.Join |
Joining a slice |
| Backtick literal | Constant multi-line text |
Read references/STRING-OPTIMIZATION.md when choosing a string concatenation strategy, using strings.Builder in loops, or deciding between fmt.Sprintf and manual concatenation.
Always measure before and after optimizing. Use Go's built-in benchmark framework and profiling tools.
go test -bench=. -benchmem -count=10 ./...
Read references/BENCHMARKS.md when writing benchmarks, comparing results with benchstat, profiling with pprof, or interpreting benchmark output.
Validation: After applying optimizations, run
bash scripts/bench-compare.shto measure the actual impact. Only keep optimizations with measurable improvement.
| Pattern | Bad | Good | Improvement |
|---|---|---|---|
| Int to string | fmt.Sprint(n) |
strconv.Itoa(n) |
~2x faster |
Repeated []byte |
[]byte("str") in loop |
Convert once outside | ~7x faster |
| Map initialization | make(map[K]V) |
make(map[K]V, size) |
Fewer allocs |
| Slice initialization | make([]T, 0) |
make([]T, 0, cap) |
~12x faster |
| Small fixed-size args | *string, *io.Reader |
string, io.Reader |
No indirection |
| Simple string join | s1 + " " + s2 |
(already good) | Use + for few strings |
| Loop string build | Repeated += |
strings.Builder |
O(n) vs O(n²) |
make with capacity hints or initializing maps and slicesPrerequisites
Time Estimate
15-45 minutes depending on use case complexity
Steps
Common Pitfalls
✓ Do
✗ Don't
💡 Pro Tips
✓ Use when
Use when skill capabilities match your task, clear ROI on time saved, and you can validate outputs. Best for repetitive tasks, learning, and quality improvement.
✗ Avoid when
Avoid when task requires deep expertise you can't validate, involves sensitive decisions, or when learning process is more valuable than speed of completion.
flutter/skills
jwynia/agent-skills
mindrally/skills
github/awesome-copilot
kostja94/marketing-skills
wispbit-ai/skills
go-performance reduced setup friction for our internal harness; good balance of opinion and flexibility.
We added go-performance from the explainx registry; install was straightforward and the SKILL.md answered most questions upfront.
Useful defaults in go-performance — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
I recommend go-performance for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
go-performance reduced setup friction for our internal harness; good balance of opinion and flexibility.
I recommend go-performance for anyone iterating fast on agent tooling; clear intent and a small, reviewable surface area.
go-performance reduced setup friction for our internal harness; good balance of opinion and flexibility.
Registry listing for go-performance matched our evaluation — installs cleanly and behaves as described in the markdown.
Useful defaults in go-performance — fewer surprises than typical one-off scripts, and it plays nicely with `npx skills` flows.
go-performance is among the better-maintained entries we tried; worth keeping pinned for repeat workflows.
showing 1-10 of 47