Borrowing it
Nothing to install: this file belongs to nehemiaharchives/lucene-kmp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/nehemiaharchives/lucene-kmp/master/.agents/skills/speedup_native/SKILL.mdgit clone --depth 1 https://github.com/nehemiaharchives/lucene-kmpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/nehemiaharchives/lucene-kmp/speedup_native)<a href="https://agentmods.dev/skills/nehemiaharchives/lucene-kmp/speedup_native"><img src="https://agentmods.dev/badge/skills/nehemiaharchives/lucene-kmp/speedup_native/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/nehemiaharchives/lucene-kmp/speedup_native"><img src="https://agentmods.dev/badge/skills/nehemiaharchives/lucene-kmp/speedup_native.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00032 | $0.01002 |
| Opus 5.5 | $0.00013 | $0.00401 |
| Sonnet 5.5 | $0.00006 | $0.00200 |
| Haiku 4.5 | $0.00003 | $0.00100 |
Grade A, and why
speedup_native scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 16d ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
How it starts
The opening of the file, as written. The whole thing — 111 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Purpose
Use this skill when a test or code path is significantly slower on Kotlin/Native than JVM and you need a reliable, repeatable way to find and fix the lowest-level bottleneck.
Scope
- Kotlin Multiplatform projects with JVM + Native targets.
- Works best when one target is clearly slower (for example, linuxX64Test vs jvmTest).
- Focuses on minimal-risk optimizations that preserve behavior.
Core Principles
- Reproduce first, optimize second.
- Measure with monotonic clocks, not assumptions.
- Always isolate the lowest-level slow step before patching.
- Keep patches minimal and reversible.
- Prefer compile/test truth over IDE false negatives for expect/actual wiring.
End-to-End Workflow
1. Reproduce with smallest failing/slow test
- Run exactly one test method that exhibits slowness.
- Keep both target runs comparable (same method, same data).
2. Add phase-level timing in test (coarse)
- Use
TimeSource.Monotonic.markNow(). - Add logs for major phases only first.
- Include total elapsed and per-phase elapsed.
3. Compare JVM vs Native and pick worst phase
- Identify the phase with the largest native/JVM ratio.
- Ignore small differences; chase the dominant hotspot.
4. Add substep timing inside worst phase (fine)
- Split compound calls into substeps (
a().b()-> timeaandbseparately). - Iterate until one substep clearly dominates native time.
5. Move instrumentation into production hot function (lowest level)
- Add temporary counters around internal branches/subcalls in the suspected function.
- Confirm the exact low-level operation causing native overhead.
6. Add dedicated reproducible performance test
- Create a small deterministic perf test in relevant test class.
- Keep correctness assertions plus one timing output line.
- Ensure it exercises the exact hot path repeatedly.
7. Implement minimal expect/actual optimization
- Keep common API identical.
- Introduce
expectin common only where needed. - Add minimal
actualimplementations:- JVM path: preserve existing behavior (baseline path).
- Native path: optimized implementation for confirmed bottleneck.
- Prefer smallest patch that changes only the hot operation.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 16d ago First seen · 111 lines · 32 tokens per session scan A 8863a600d5dc
speedup_native is a skill published in the GitHub repository nehemiaharchives/lucene-kmp (11 stars, last pushed 13d ago), licensed Apache-2.0. It adds 32 tokens to every session and 1,002 once invoked, about $0.0001 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-10-21.
speedup_native compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| speedup_nativenehemiaharchives/lucene-kmp | Skill | 11 | 13d ago | Apache-2.0 | A | 32 | Claude Code, Codex |
| kotlin-tooling-native-build-performanceKotlin/kotlin-agent-skills | Skill | 1.1k | 7d ago | Apache-2.0 | A | 96 | Claude Code, Codex |
| compose-multiplatformericrisco/rsc-harness | Skill | 503 | 2d ago | MIT | A | 80 | Claude Code, Codex |
| compose-performancechrisbanes/skills | Skill | 1.1k | yesterday | Apache-2.0 | A | 42 | Claude Code |
| extract-apkniki914/zafiro | Skill | 340 | 4d ago | MIT | A | 105 | Claude Code, Codex |
| test-hang-watchdogniki914/zafiro | Skill | 340 | 4d ago | MIT | A | 66 | Claude Code, Codex |
| assistant-add-supportniki914/zafiro | Skill | 340 | 4d ago | MIT | A | 61 | Claude Code, Codex |