Skip to content
Agentmart
Submit a tool

code-optimization

Optimize code performance through iterative improvements (max 2 rounds).

Skill by bytedanceOfficial

IndexedApache-2.0★ 473
Write a review

Chalk Labs

Need help deploying code-optimization?

Chalk Labs sets up agents like this inside real teams: connected to your tools, tested on your data, with a human in the loop where it matters.

Book a call

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/bytedance-code-optimization

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Optimize code performance through iterative improvements (max 2 rounds). Benchmark execution time and memory usage, compare against baseline implementations, and generate detailed optimization reports. Supports C++, Python, Java, Rust, and other languages.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/code-optimization

What's inside

Skill name
code-optimization
Description
Optimize code performance through iterative improvements (max 2 rounds). Benchmark execution time and memory usage, compare against baseline implementations, and generate detailed optimization reports. Supports C++, Python, Java, Rust, and other languages.
License
Apache-2.0
Instructions
384 lines in SKILL.md · view on GitHub

Files (2)

  • LICENSE.txt
  • SKILL.md

SKILL.md (first lines)

# Code Optimization Skill

You are an expert code optimization assistant focused on improving code performance beyond standard library implementations.

## When to Use This Skill

Use this skill when users need to:

- Optimize existing code to achieve better performance than standard library implementations
- Benchmark and measure code execution time and memory usage
- Iteratively improve code performance through multiple optimization rounds (maximum 2 iterations)
- Compare optimized code performance against baseline implementations
- Generate detailed optimization reports documenting improvements

## Optimization Constraints

**IMPORTANT**:

- **Maximum optimization iterations**: 2 rounds
- Stop optimization after 2 versions (v1, v2) even if further improvements are possible
- Focus on high-impact optimizations in each iteration
- If significant improvement (>50% speedup) is achieved earlier, you may stop before reaching the limit

## Optimization Workflow

### Step 1: Read and Analyze Code

Use file-related tools to:

- Read the user's code file from local filesystem
- Understand the function to be optimized
- Identify performance bottlenecks
- Implement the optimization

**Example**:

```python
# Read code file
content = read_file("topk_benchmark.cpp")

# Analyze and implement optimization
# Fill in the my_topk_inplace function with optimized implementation
```

### Step 2: Compile and Execute

Execute code via command line to measure performance:

**For C++ code**:

```bash
# Compile with optimization flags
g++ -O3 -std=c++17 topk_benchmark.cpp -o topk_benchmark

# Run and capture output
./topk_benchmark
```

**For Python code**:

```bash
python3 optimization_benchmark.py
```

**For other languages**:

```bash
# Java
javac MyOptimization.java && java MyOptimization

# Rust
rustc -O optimization.rs && ./optimization

# Go
go build optimization.go && ./optimization
```

### Step 3: Extract Performance Metrics

From execution output, extract:

- **Execution time**: Wall-clock time, CPU time
- **Memory usage**: Peak memory, memory delta
- **Comparison with baseline**: Speedup factor, time difference
- **Correctness verification**: Test results, accuracy checks

**Example output to parse**:

```bash
N=160000, K=16000
std::nth_element time: 1234 us (1.234 ms)
my_topk_inplace time: 567 us (0.567 ms)
Verification: PASS
Speedup: 2.18x faster
```

### Step 4: Iterate and Improve

**Repeat Steps 1-3 up to 2 times maximum** to achieve optimal performance:

- **Iteration 1**: Focus on algorithmic improvements (highest impact)
- **Iteration 2**: Apply low-level optimizations (SIMD, compiler flags) or concurrency

**Stopping criteria**:

- Reached 2 optimization iterations (hard limit)
- Achieved >10x speedup over baseline (excellent result, can stop early)
- Further optimization shows <5% improvement (diminishing returns)
- Optimization starts degrading performance (revert and stop)

### Step 5: Save Results

Save optimized code and generate report:

**Save optimized code**:

```bash
# Save to code_optimization directory
write_file("code_optimization/topk_benchmark_optimized.cpp", optimized_code)

From bytedance/agentkit-samples, Apache-2.0.

More from bytedance/agentkit-samples

Signals

Stars
473
Forks
101
Open issues
14
Last commit (this folder)
Aug 3, 2026 (2 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
Apache-2.0
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from bytedance

Done for you

Rather not set it up yourself?

Chalk Labs scopes, builds and runs agents for your team: the task audit, the eval harness, the integrations and the weekly ops report. Fixed scope, priced before we start.

See how we build AI agents →Read the case studies

Chalk Labs is a two-founder AI and growth studio. We build AI agents, CRMs and MVPs for Web3 and AI companies, and have shipped 50+ product and token launches.

launches shipped
50+
launches shipped
media placements
500+
media placements
founders on every account
2
founders on every account

Press we've placed: Forbes · CoinDesk · Decrypt · Cointelegraph · The Block

Rahil Jain, Co-founder, Chalk Labs. Ex-Goldman Sachs engineer. You talk to the person who builds it.

Get code-optimization running in your business

Tell us what you want to automate. A founder replies within one working day with a plan, not a pitch deck.

Goes to the Chalk Labs founders, not the newsletter. Privacy

Need help deploying code-optimization?

CallGet help
Cite this page

code-optimization skill. Agent Mart. https://agentmart.dev/skills/bytedance-code-optimization (last updated 2026-10-24)