dstack
DStack: opinionated methodology between vibes and specs. It's very dalcom! (means sweet & tasty)
Install / Use
npx skills add gosuda/dstackInstalls into whichever agent you are using.
Devin Config
Devin AI agent config
Quality Score
Category
Education & ResearchSupported Platforms
Tags
Our assessment of dstack
dstack scores 59/100 on our quality scale, 439th of 448 Education & Research skills we index.
Its Devin Config is 35 KB long, well organised into 26 sections with 17 code examples: a thorough specification that gives an agent plenty to work with.
It has no GitHub stars yet, so there is no community track record; judge it on its content.
Maintenance, license and trust
- We could not determine when the repository was last updated.
- No license is declared. By default that means all rights are reserved: you can read it, but reusing or redistributing it is not clearly permitted. Ask the author before building on it commercially.
- Its trust signals score 68/100, with 3 cautions from licensing, adoption, age or documentation. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
dstack compared with similar skills
All 4 of these similar skills score higher than dstack; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| dstack (this skill)by gosuda | 59 | 0 | — | Devin Config |
| last30days-skillby mvanhorn | 100 | 66.0k | 2d ago | CLAUDE.md |
| app-store-optimizationby sickn33 | 100 | 47.9k | 11d ago | SKILL.md |
| arborby K-Dense-AI | 100 | 46.4k | 39d ago | SKILL.md |
| clinical-reportsby K-Dense-AI | 100 | 46.4k | 39d ago | SKILL.md |
Frequently asked questions
- How do I install dstack?
- Run
npx skills add gosuda/dstack. The install tabs above show the steps for each supported agent. - Which AI agents does dstack work with?
- It is written for Devin, as a Devin Config file. Other agents that read the same format can often use it too.
- Is dstack safe to use?
- It declares no license and scores 68/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is dstack still maintained?
- We could not determine when the repository was last updated.
Skill content
View source on GitHubPerformance profiling and optimization
Profile before you optimize. Most Go performance problems are allocation rate (GC pressure) or contention (scheduler stalls), rarely the algorithm. Measure with pprof/trace, change one thing, A/B with benchstat. The toolchain already does constant folding, DCE, bounds-check elimination, inlining, devirtualization, escape analysis, and memclr, so don't hand-roll those.
Verified against Go 1.26.4 (stable, 2026-06) and the final Go 1.27 release notes (GA 2026-08-19). Tags
[1.N]mark the release a claim lands in;[exp 1.N]= experimental behind aGOEXPERIMENT. Triangulated from multi-source research; resolved to go.dev/pkg.go.dev where reports diverged.
TL;DR: the modern deltas (read first)
for b.Loop()[1.24] replacesfor i := 0; i < b.N: setup runs once per-count, params/results stay alive (no manualsink), timer is automatic. Trap: 1.24/1.25b.Loopsuppressed inlining of the body (phantom allocs); [1.26] fixed it; re-measure anyallocs/opfrom 1.24/1.25.- Green Tea GC is the default [1.26] (span-granular, locality-aware marking): 10-40% less GC overhead on GC-heavy programs, +~10% on AVX-512 amd64. The
GOEXPERIMENT=nogreenteagcopt-out remains available in Go 1.27.3 on linux/amd64. It reduces, not eliminates, GC cost; allocation reduction still compounds. runtime.AddCleanup[1.24] supersedesruntime.SetFinalizer: multiple cleanups/object, interior pointers, no cycle leaks, no resurrection, no extra-GC-cycle delay.- Zero-copy str↔[]byte =
unsafe.String/unsafe.Slice[1.20], neverreflect.StringHeader/SliceHeader(deprecated, GC-invisible, broken under modern stack allocation). deferis ~1 ns since open-coded defers [1.14]: "avoid defer in hot paths" is stale (exception: defers in a tight loop or >8 per frame fall back to the heap path).- The compiler stack-allocates slice backing stores in far more cases [1.25][1.26] (incl.
appendgrowth and some escaping slices moved to heap only at return). "Variable-sized backing store always heaps" is stale; verify with-gcflags=-m. benchstatchanged: columns aresec/op/B/op/allocs/op+vs basewith~for non-significant (Mann-Whitney U). The librarygolang.org/x/perf/benchstatis deprecated; usegolang.org/x/perf/cmd/benchstat.
Table of contents
- Runtime cost reference
- Profiling workflow
- CPU profiling
- Execution tracer & flight recorder
- Profile-guided optimization (PGO)
- Memory profiling and escape analysis
- Allocation reduction patterns
- sync.Pool for hot-path objects
- String and slice optimization
- Inlining
- Memory layout & false sharing
- GC tuning
- Benchmarking methodology
- SIMD
- Caching strategies
- Library landscape & status
- Version map 1.20→1.27
- Anti-patterns / what models get wrong
Runtime cost reference {#runtime-costs}
Order-of-magnitude estimates on modern amd64/arm64, not guarantees. There is no authoritative portable ns/op table (varies by microarch, OS, patch level, PGO/GC state, workload); benchmark on target. Treat as relative.
| Operation | Rough cost | Notes |
|---|---|---|
| Direct call | ~1-2 ns | plus stack-growth check |
| Interface / indirect call | ~2-5 ns | blocks inlining; PGO can devirtualize hot ones |
| defer (common case) | ~1 ns | open-coded [1.14]; was ~50 ns pre-1.14. Loop/>8 defers fall back to heap path |
| Small heap allocation | ~20-100 ns | + amortized GC scan/sweep; [1.27] size-specialized malloc cuts <80 B allocs up to ~30% |
| Map access (hit) | ~10-30 ns | Swiss Tables [1.24] improved this |
| Slice append (no grow) | ~1-3 ns | grow = alloc + copy |
| Channel send/recv (uncontended) | ~50-120 ns | buffered slightly cheaper; contended far higher |
| sync.Mutex lock+unlock (uncontended) | ~10-25 ns | CAS fast path inlined; slow path outlined lockSlow; new internal mutex [1.24] |
| Atomic load/store/CAS | ~1-10 ns | CAS under contention much higher |
| Goroutine create / context switch | ~1-2 µs / ~100-200 ns | ~2 KiB initial stack; switch far cheaper than an OS thread |
| cgo call | ~40 ns | [1.26] cut baseline ~30% (streamlined thread-state mgmt) |
| L1 hit / main memory | ~1 ns / ~100 ns | the gap is why false sharing and poor locality dominate |
Profiling workflow {#profiling-workflow}
Measure → identify the limiting resource → use the matching profiler → fix one bottleneck class → re-benchmark. The GC guide says start with heap profiles when GC cost matters, and that alloc_space (allocation rate) is usually the most useful view for cutting GC cost, not inuse_space (live memory).
Two front-ends, one backend: runtime/pprof (manual/batch) and net/http/pprof (import _ "net/http/pprof" registers on http.DefaultServeMux). All /debug/pprof/ paths require GET [1.22].
| Profile | Samples | Enable | Endpoint |
|---|---|---|---|
| CPU | on-CPU time, ~100 Hz | pprof.StartCPUProfile/Stop | /debug/pprof/profile?seconds=30 |
| Heap (inuse/alloc) | live + cumulative allocs, every MemProfileRate (512 KiB) | pprof.WriteHeapProfile | /heap (?gc=1), /allocs |
| Block | time blocked on chan/select/timer/sync | SetBlockProfileRate(n) (off by default) | /block |
| Mutex | contention on Mutex/RWMutex | SetMutexProfileFraction(n) (off by default) | /mutex |
| Goroutine | live goroutine stacks | none | /goroutine |
| goroutineleak [exp 1.26 / GA 1.27] | goroutines on an unreachable primitive | GOEXPERIMENT=goroutineleakprofile (1.26 only; GA in 1.27, experiment deleted) | /debug/pprof/goroutineleak |
/allocs and /heap are the same profile, different default sample type. Block/mutex are useless unless sampling is enabled in-process first; skipping it is the #1 mistake. SetBlockProfileRate(1)/SetMutexProfileFraction(1) cost 5-20% CPU under load; sample instead:
// WRONG: every event; catastrophic under concurrency
runtime.SetBlockProfileRate(1); runtime.SetMutexProfileFraction(1)
// RIGHT: ~1 event per 10000 ns blocked; ~1/100 contention events
runtime.SetBlockProfileRate(10000); runtime.SetMutexProfileFraction(100)
Enable globally only at conservative rates, or via an admin endpoint during an incident. Interpretation trap: mutex-profile stacks point to the end of the critical section that caused contention, not the waiter; since [1.25] runtime-internal lock contention matches this too.
Reading: go tool pprof -http=:8080 cpu.pprof (flame graph is the default view [1.26]; graph under View → Graph). REPL: top20 -cum, list <fn>, peek <fn>, disasm. flat = self, cum = self + callees (hot leaves by flat, hot paths by cum). Differential: go tool pprof -diff_base=old.pprof new.pprof. [1.23] profile stack depth went 32→128 frames (better deep attribution).
CPU profiling {#cpu-profiling}
import "runtime/pprof"
func main() {
f, _ := os.Create("cpu.prof"); defer f.Close()
if err := pprof.StartCPUProfile(f); err != nil { log.Fatal(err) }
defer pprof.StopCPUProfile()
// ... workload
}
// In benchmarks the framework wires it: go test -bench=. -cpuprofile=cpu.prof
Stale-model note: flame graphs do not need uber/go-torch (deprecated); go tool pprof -http renders them natively and they're the default view in 1.26.
Execution tracer & flight recorder {#tracing}
runtime/trace records goroutine create/block/unblock, scheduler latency, syscalls, GC, heap-size changes, P start/stop with ns timestamps + stacks. It reveals what CPU sampling cannot: a channel bottleneck shows as the absence of execution. Use CPU profile for where time goes; trace for why goroutines aren't running. Annotate with a task (spans goroutines via context.Context, one request) and a region (same-goroutine interval, one stage):
trace.Start(f); defer trace.Stop() // or: go test -trace=trace.out; go tool trace trace.out
ctx, task := trace.NewTask(ctx, "http_request"); defer task.End()
trace.WithRegion(ctx, "db", func() { queryDB(ctx) })
Overhead is stale folklore. Pre-1.21 tracing cost ~10-20% CPU; [1.21] cut traceback cost ~10× (≈1-2%), and [1.22] made the format splittable, enabling continuous tracing/flight recording. [1.23] flushes trace data on uncaught panics.
Flight recorder [1.25]
A sliding in-memory ring buffer over the trace: snapshot only the window before a rare event (timeout, latency spike) instead of spooling continuously. Lives in runtime/trace (the golang.org/x/exp/trace prototype is outdated).
fr := trace.NewFlightRecorder(trace.FlightRecorderConfig{
MinAge: 10 * time.Second, // retain ≈ this long; set ~2× your debug window
MaxBytes: 10 << 20, // memory cap: TAKES PRECEDENCE over MinAge
})
if err := fr.Start(); err != nil { log.Fatal(err) }
defer fr.Stop()
if dur > 500*time.Millisecond { f, _ := os.Create("incident.trace"); fr.WriteTo(f); f.Close() }
API: Start() error, WriteTo(io.Writer) (int64, error), Stop(), Enabled() bool; defaults MinAge 10 s, MaxBytes 10 MiB. Only one recorder per process; one WriteTo at a time (Stop blocks until in-flight writes finish); may coexist with a trace.Start consumer.
Goroutine-leak profile [exp 1.26 → GA 1.27]
Piggybacks on the GC reachability graph: flags a goroutine blocked on a channel/Mutex/Cond whose primitive is unreachable from any runnable goroutine or global root (topologically impossible to unblock): zero false positives, zero overhead unless in use. Cannot detect leaks via primitives still reachable through globals/live locals. Makes leaks runtime-profiled data, superseding go.uber.org/goleak for production detection. GA in [1.27]: profile type goroutineleak in runtime/pprof, endpoint /debug/pprof/goroutineleak; the GOEXPERIMENT=goroutineleakprofile setting was deleted.
Profile-guided optimization (PGO) {#pgo}
PGO feeds a representative CPU pprof profile back to the compiler, which then inlines hot functions more aggressively and devirtualizes hot interface calls. Whole-program: all packages incl. dependencies are recompiled. Preview [1.20], GA [1.21] with -pgo=auto default. Realistic gain 2-14%, zero code change, the cheapest big win.
curl -o cpu.pprof "http://service:6060/debug/pprof/profile?seconds=30"
mv cpu.pprof ./cmd/server/default.pgo # MAIN package dir; commit to VCS (auto-detected [1.21+])
go build ./cmd/server # explicit: -pgo=./path.pprof or -pgo=off
go version -m ./server | grep pgo # verify applied
go tool pprof -proto a.pprof b.pprof > default.pgo # merge profiles for robustness
Truths & pitfalls: microbenchmarks are bad PGO profiles (sliver of program → tiny gains); use real traffic; the go command errors if default.pgo is in a non-main package; profiles are portable across GOOS/GOARCH; source-stable (last week's profile matches today's build by in-function line offsets; PGO-on-PGO doesn't flap, so no two-stage canary); a stale profile optimizes cold paths but won't slow hot ones. Build overhead is no longer a reason to skip it [1.23]: from 100%+ on large builds down to single-digit %. Field data: Datadog ~5.4% (1.21), >10% on some 1.22 services; Uber runs it fleet-wide. "PGO only affects layout, not inlining" is wrong; it raises the inlining budget for hot call sites (see Inlining).
Memory profiling and escape analysis {#memory}
The compiler decides stack (pointer bump, auto-freed) vs heap (G
Truncated for display — read the full file on GitHub.
Related Skills
last30days-skill
66.0kAI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary
app-store-optimization
47.9kComplete App Store Optimization (ASO) toolkit for researching, optimizing, and tracking mobile app performance on Apple App Store and Google Play Store
arbor
46.4kApplies Arbor Hypothesis Tree Refinement to research artifacts with repeatable evaluators, including model training, agent harnesses, data synthesis and benchmark optimization.
clinical-reports
46.4kCreates safety-bounded draft structures and runs local deterministic checks for clinical case, diagnostic, trial, safety, and aggregate research reports. Use only with synthetic, de-identified, or aggregate inputs and verified source-fact manifests; every output requires qualified review.
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
