Django Filter Benchmark
saleor/saleor
Benchmarks Django ORM filters in Saleor by generating bulk data, extracting the SQL and running EXPLAIN ANALYZE to check index usage.
Analyzes and optimizes code for better performance, memory usage, and efficiency.
$ npx skills add ArabelaTso/Skills-4-SE --skill code-optimizer -a claude-codeProject install by default; add -g for ~/.claude/skills/.
$ gh skill install ArabelaTso/Skills-4-SE code-optimizer --agent claude-codeProject scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/code-optimizer .claude/skills/code-optimizer && rm -rf skills-srcUse ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.
Claude Code skills documentation · loads skills from .claude/skills/
Install the "code-optimizer" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/code-optimizer into .claude/skills/code-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-optimizer", then confirm the skill loads.Claude Code copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$skill-installer install https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/code-optimizerType this inside Codex. $skill-installer <name> installs a curated skill from openai/skills. The installer writes to $CODEX_HOME/skills (default ~/.codex/skills). Restart Codex if the skill does not show up.
$ npx skills add ArabelaTso/Skills-4-SE --skill code-optimizer -a codexProject install goes to .agents/skills/; add -g for ~/.codex/skills/.
$ gh skill install ArabelaTso/Skills-4-SE code-optimizer --agent codexProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .agents/skills && cp -r skills-src/skills/code-optimizer .agents/skills/code-optimizer && rm -rf skills-srcUse ~/.agents/skills/ instead of .agents/skills for a personal install.
Codex skills documentation · loads skills from .agents/skills/
Install the "code-optimizer" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/code-optimizer into .agents/skills/code-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-optimizer", then confirm the skill loads.Codex copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ArabelaTso/Skills-4-SE --skill code-optimizer -a cursorProject install goes to .agents/skills/; add -g for ~/.cursor/skills/.
$ gh skill install ArabelaTso/Skills-4-SE code-optimizer --agent cursorProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .cursor/skills && cp -r skills-src/skills/code-optimizer .cursor/skills/code-optimizer && rm -rf skills-srcUse ~/.cursor/skills/ instead of .cursor/skills for a personal install.
Cursor skills documentation · loads skills from .cursor/skills/, .agents/skills/, .claude/skills/, .codex/skills/
Install the "code-optimizer" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/code-optimizer into .cursor/skills/code-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-optimizer", then confirm the skill loads.Cursor copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gemini skills install https://github.com/ArabelaTso/Skills-4-SE.git --path skills/code-optimizer--scope user (default) or --scope workspace; --path is the subfolder of the repo that holds the skill; --consent skips the security confirmation prompt.
$ npx skills add ArabelaTso/Skills-4-SE --skill code-optimizer -a gemini-cliProject install goes to .agents/skills/; add -g for ~/.gemini/skills/.
$ gh skill install ArabelaTso/Skills-4-SE code-optimizer --agent gemini-cliProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .gemini/skills && cp -r skills-src/skills/code-optimizer .gemini/skills/code-optimizer && rm -rf skills-srcUse ~/.gemini/skills/ instead of .gemini/skills for a personal install, then run /skills reload.
Gemini CLI skills documentation · loads skills from .gemini/skills/, .agents/skills/
Install the "code-optimizer" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/code-optimizer into .gemini/skills/code-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-optimizer", then confirm the skill loads.Gemini CLI copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ gh skill install ArabelaTso/Skills-4-SE code-optimizerInstalls for Copilot at project scope by default; add --scope user for a personal install. Preview a skill first with gh skill preview. Needs GitHub CLI 2.90.0 or later (public preview).
$ npx skills add ArabelaTso/Skills-4-SE --skill code-optimizer -a github-copilotProject install goes to .agents/skills/; add -g for ~/.copilot/skills/.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .github/skills && cp -r skills-src/skills/code-optimizer .github/skills/code-optimizer && rm -rf skills-srcUse ~/.copilot/skills/ instead of .github/skills for a personal install. Commit .github/skills so cloud agent and code review can use it.
GitHub Copilot skills documentation · loads skills from .github/skills/, .claude/skills/, .agents/skills/
Install the "code-optimizer" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/code-optimizer into .github/skills/code-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-optimizer", then confirm the skill loads.GitHub Copilot copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
$ npx skills add ArabelaTso/Skills-4-SE --skill code-optimizer -a opencodeOpenCode documents no install command of its own. Project install goes to .agents/skills/; add -g for ~/.config/opencode/skills/.
$ gh skill install ArabelaTso/Skills-4-SE code-optimizer --agent opencodeProject scope by default (.agents/skills/); add --scope user for a personal install.
$ git clone --depth 1 https://github.com/ArabelaTso/Skills-4-SE.git skills-src && mkdir -p .opencode/skills && cp -r skills-src/skills/code-optimizer .opencode/skills/code-optimizer && rm -rf skills-srcUse ~/.config/opencode/skills/ instead of .opencode/skills for a personal install.
OpenCode skills documentation · loads skills from .opencode/skills/, .claude/skills/, .agents/skills/
Install the "code-optimizer" agent skill from https://github.com/ArabelaTso/Skills-4-SE/tree/main/skills/code-optimizer into .opencode/skills/code-optimizer/ in this project. Copy the whole folder (SKILL.md and every file beside it), keep the folder name "code-optimizer", then confirm the skill loads.OpenCode copies the folder itself, the same result as the manual copy. Check what it changed before you commit it.
code-optimizerAnalyzes and optimizes code for better performance, memory usage, and efficiency.
Code Optimizer is an agent skill from ArabelaTso/Skills-4-SE. Analyzes and optimizes code for better performance, memory usage, and efficiency. Use when code is slow, memory-intensive, or inefficient. Supports Python and Java optimization including execution speed improvements, memory reduction, database query optimization, and I/O efficiency. Provides before/after examples with detailed explanations of why optimizations work, complexity analysis, and measurable performance improvements.
Its SKILL.md is about 3.1k tokens, which your agent loads only when the skill is triggered. It is a single SKILL.md file with no bundled scripts.
It sits in Databases, covering Query optimization. It works with Java and Python. The repository describes itself as: A curated list of 180+ useful Claude Skills for Software Engineering and resources for customizing AI for SE workflows. The licence is Apache-2.0.
7 steps, taken from the step headings in SKILL.md.
Read from SKILL.md and the folder at commit 4f38503. It shows what the files ask for, not the result of running them.
Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.
From allowed-tools in the SKILL.md frontmatter.
Shell commands in SKILL.md call:
pythonpipjavaFrom the folder's file list and the shell code blocks in SKILL.md.
No URLs in SKILL.md. Its commands use pip, which can reach the network depending on how they are called.
From URLs in SKILL.md, links to its own repository left out.
Names no API keys, tokens, secrets or passwords.
From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.
Code Optimizer loads about 3.1k tokens when it runs. Until then it costs about 111 tokens; SKILL.md has 643 words of instructions outside code blocks.
Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.
The automated check found no risky patterns in SKILL.md.
Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.
The full file from ArabelaTso/Skills-4-SE at commit 4f38503, republished under its Apache-2.0 licence (© ArabelaTso). 643 words, ~3,143 tokens.
.claude/skills/code-optimizer/SKILL.md (or your agent's skills folder).Improve code performance, memory usage, and efficiency through systematic optimization.
This skill helps optimize code by:
Analyze code to find performance bottlenecks.
Look for:
Quick Analysis Questions:
Determine the type of optimization needed.
Execution Speed:
Memory Usage:
Database Operations:
I/O Operations:
Provide before/after code with clear explanations.
Optimization Template:
## Optimization: [Brief Description]
### Before (Inefficient)
```[language]
[original code]Issues:
Complexity: O([complexity]) Performance: [estimated time/memory]
[optimized code]Improvements:
Complexity: O([new complexity]) Performance: [estimated time/memory] Gain: [X% faster / Y% less memory]
[Detailed explanation of the optimization]
Pros:
Cons:
### Step 4: Measure and Validate
Ensure optimization actually improves performance.
**Measurement Techniques:**
**Python:**
```python
import time
import memory_profiler
# Time measurement
start = time.time()
result = function()
elapsed = time.time() - start
print(f"Elapsed: {elapsed:.4f}s")
# Memory measurement
from memory_profiler import profile
@profile
def function():
# Code to profile
passJava:
// Time measurement
long start = System.nanoTime();
result = function();
long elapsed = System.nanoTime() - start;
System.out.println("Elapsed: " + elapsed / 1_000_000 + "ms");
// Memory measurement
Runtime runtime = Runtime.getRuntime();
long before = runtime.totalMemory() - runtime.freeMemory();
result = function();
long after = runtime.totalMemory() - runtime.freeMemory();
System.out.println("Memory used: " + (after - before) / 1024 + "KB");Validation Checklist:
# Before: O(n) with overhead
numbers = []
for i in range(1000):
if i % 2 == 0:
numbers.append(i * 2)
# After: O(n) faster execution
numbers = [i * 2 for i in range(1000) if i % 2 == 0]
# Gain: 2-3x faster# Before: O(n) memory
def get_numbers(n):
result = []
for i in range(n):
result.append(i ** 2)
return result
numbers = get_numbers(1000000) # Uses ~8MB memory
# After: O(1) memory
def get_numbers(n):
for i in range(n):
yield i ** 2
numbers = get_numbers(1000000) # Uses minimal memory
# Gain: 99% less memory for large n# Before: Slower
total = 0
for num in numbers:
total += num
# After: Faster (C implementation)
total = sum(numbers)
# Gain: 10-20x faster for large lists# Before: Repeated lookups
for i in range(len(data)):
process(data[i])
# After: Single lookup
for item in data:
process(item)
# Or with enumerate
for i, item in enumerate(data):
process(item)
# Gain: Faster iteration, more Pythonic# Before: O(n) per lookup
items = [1, 2, 3, 4, 5, ...] # Large list
if x in items: # O(n) lookup
do_something()
# After: O(1) per lookup
items = {1, 2, 3, 4, 5, ...} # Set
if x in items: # O(1) lookup
do_something()
# Gain: 100x faster for large collectionsSee references/python_optimizations.md for comprehensive Python optimization patterns.
// Before: O(n²) - creates n strings
String result = "";
for (int i = 0; i < 1000; i++) {
result += i + ","; // Creates new string each time
}
// After: O(n) - single buffer
StringBuilder result = new StringBuilder();
for (int i = 0; i < 1000; i++) {
result.append(i).append(",");
}
String output = result.toString();
// Gain: 100x faster for large loops// Before: Wrong data structure
List<Integer> numbers = new ArrayList<>();
numbers.contains(42); // O(n) lookup
// After: Right data structure
Set<Integer> numbers = new HashSet<>();
numbers.contains(42); // O(1) lookup
// Gain: 1000x faster for large collections// Before: Creates objects in loop
for (int i = 0; i < 1000; i++) {
String key = new String("key" + i); // Unnecessary
map.put(key, value);
}
// After: Reuse or use literals
for (int i = 0; i < 1000; i++) {
String key = "key" + i; // String interning
map.put(key, value);
}
// Gain: Less GC pressure, faster// Before: Autoboxing overhead
List<Integer> numbers = new ArrayList<>();
for (int i = 0; i < 1000000; i++) {
numbers.add(i); // Boxing int to Integer
}
// After: Primitive arrays or specialized libraries
int[] numbers = new int[1000000];
for (int i = 0; i < 1000000; i++) {
numbers[i] = i; // No boxing
}
// Or use TIntArrayList from Trove
TIntArrayList numbers = new TIntArrayList();
// Gain: 50% less memory, faster accessSee references/java_optimizations.md for comprehensive Java optimization patterns.
# Before: N+1 queries
users = User.query.all() # 1 query
for user in users:
posts = user.posts.all() # N queries
process(posts)
# After: Single query with join
users = User.query.options(
joinedload(User.posts)
).all() # 1 query
for user in users:
posts = user.posts # Already loaded
process(posts)
# Gain: 100x faster for large datasets-- Before: Full table scan O(n)
SELECT * FROM users WHERE email = 'user@example.com';
-- After: Index lookup O(log n)
CREATE INDEX idx_users_email ON users(email);
SELECT * FROM users WHERE email = 'user@example.com';
-- Gain: 1000x faster for large tables# Before: N round trips
for item in items:
db.execute("INSERT INTO table VALUES (?)", (item,))
db.commit()
# After: Single batch
db.executemany("INSERT INTO table VALUES (?)",
[(item,) for item in items])
db.commit()
# Gain: 10-100x fasterSee references/database_optimizations.md for comprehensive database optimization patterns.
# Before: Unbuffered (many system calls)
with open('file.txt', 'r') as f:
for line in f:
process(line.strip())
# After: Buffered reading
with open('file.txt', 'r', buffering=8192) as f:
for line in f:
process(line.strip())
# Gain: 10x faster for small lines# Before: N API calls
for user_id in user_ids:
user = api.get_user(user_id) # 100 calls
process(user)
# After: Batch API call
users = api.get_users_batch(user_ids) # 1 call
for user in users:
process(user)
# Gain: 100x faster (network latency)Python Profiling:
# Time profiling
python -m cProfile -s cumulative script.py
# Line-by-line profiling
pip install line_profiler
kernprof -l -v script.py
# Memory profiling
pip install memory_profiler
python -m memory_profiler script.pyJava Profiling:
# JVM profiling with VisualVM
jvisualvm
# Or Java Flight Recorder
java -XX:+UnlockCommercialFeatures -XX:+FlightRecorder \
-XX:StartFlightRecording=duration=60s,filename=recording.jfr \
MyAppOptimize the 20% of code that takes 80% of time.
Find Hot Paths:
Compare before and after:
import timeit
# Before
before = timeit.timeit(
'old_function(data)',
setup='from module import old_function, data',
number=1000
)
# After
after = timeit.timeit(
'new_function(data)',
setup='from module import new_function, data',
number=1000
)
improvement = (before - after) / before * 100
print(f"Improvement: {improvement:.1f}%")Don't sacrifice code clarity for minor gains.
Good Optimization:
# Clear and fast
users = [u for u in all_users if u.is_active]Bad Optimization:
# Obscure for minimal gain
users = list(filter(lambda u: u.is_active, all_users))references/python_optimizations.md - Comprehensive Python optimization techniques and patternsreferences/java_optimizations.md - Comprehensive Java optimization techniques and patternsreferences/database_optimizations.md - Database query and schema optimization strategies| Optimization Type | Python | Java | Impact |
|---|---|---|---|
| Algorithm complexity | Use better algorithm | Use better algorithm | High |
| Data structures | set/dict for lookup | HashMap/HashSet | High |
| String building | join() or f-strings | StringBuilder | High |
| Generators | yield | Stream API | Medium (memory) |
| Caching | @lru_cache | ConcurrentHashMap | Medium-High |
| Batching | Batch DB/API calls | Batch operations | High |
| Indexing | Use dict/set | Add DB indexes | High |
| Lazy evaluation | Generators | Streams/Suppliers | Medium |
© ArabelaTso, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file
Just SKILL.md in skills/code-optimizer of ArabelaTso/Skills-4-SE.
Open the folder on GitHubat commit 4f38503
Code Optimizer next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.
| Skill | Stars | Used in | Tokens | Auto-check | Licence | Repo updated |
|---|---|---|---|---|---|---|
| Code Optimizer this skillArabelaTso/Skills-4-SE | 253 | — | ~3.1k | Automated safety check: Pass | Apache-2.0 | |
| Django Filter Benchmarksaleor/saleor | 23k | — | ~2.3k | Automated safety check: Pass | BSD-3-Clause | |
| Bench Performancevortex-data/vortex | 3.2k | — | ~5.1k | Automated safety check: Pass | Apache-2.0 | |
| Query Plan Snapshot CLIeclipse-rdf4j/rdf4j | 420 | — | ~1.5k | Automated safety check: Pass | BSD-3-Clause | |
| BigQuery Slot and Cost Optimizergoogle/skills | 21k | — | ~2.3k | Automated safety check: Pass | Apache-2.0 | |
| DBoracle/skills | 873 | — | ~1.4k | Automated safety check: Pass | UPL-1.0 |
saleor/saleor
Benchmarks Django ORM filters in Saleor by generating bulk data, extracting the SQL and running EXPLAIN ANALYZE to check index usage.
vortex-data/vortex
Iterate on Vortex vx-bench query performance with benchmark comparisons, engine-specific benchmark flags, RUSTLOG/tracing/metrics/explain output, and Samply profiles.
eclipse-rdf4j/rdf4j
Use QueryPlanSnapshotCli to capture and compare RDF4J query plans, then assess likely performance improvements/regressions from execution verification and semantic plan diffs.
google/skills
Analyzes BigQuery slot use, query costs and execution bottlenecks from INFORMATION_SCHEMA to diagnose slow queries, slot contention and unpartitioned scans.
oracle/skills
Oracle Database guidance for SQL, PL/SQL, SQLcl, ORDS, Oracle Vector SDK, administration, app development, performance, security, migrations, and agent-safe database workflows.
google/skills
Assists in provisioning instances/tables, designing performant schemas, and querying data in Bigtable.
ArabelaTso/Skills-4-SE
Generate prioritized CVE watchlists and actionable security recommendations for repositories.
ArabelaTso/Skills-4-SE
Automatically migrate Python web applications between frameworks (Flask → FastAPI, Django → FastAPI).
ArabelaTso/Skills-4-SE
Generate test cases using metamorphic testing by applying transformations based on metamorphic properties.
ArabelaTso/Skills-4-SE
Instruments programs to capture execution traces specifically for reproducing reported bugs, enabling consistent replay and diagnosis of failures.
ArabelaTso/Skills-4-SE
Automatically migrate Spring MVC applications to Spring Boot.
ArabelaTso/Skills-4-SE
Instrument programs (Python, C/C++, Java) to capture snapshots of key program states at runtime, including variables, memory, and call stacks.
Categories
Analyzes and optimizes code for better performance, memory usage, and efficiency. Code Optimizer is an agent skill from ArabelaTso/Skills-4-SE. Analyzes and optimizes code for better performance, memory usage, and efficiency.
Code Optimizer fits situations like: memory-intensive; tasks that involve Query optimization.
Run `npx skills add ArabelaTso/Skills-4-SE --skill code-optimizer -a claude-code`. Or copy the skill folder (skills/code-optimizer in ArabelaTso/Skills-4-SE) into .claude/skills/code-optimizer in your project. Claude Code loads it when a task matches its description.
Run `npx skills add ArabelaTso/Skills-4-SE --skill code-optimizer -a codex`. Or copy the skill folder (skills/code-optimizer in ArabelaTso/Skills-4-SE) into .agents/skills/code-optimizer in your project. Codex loads it when a task matches its description.
Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add ArabelaTso/Skills-4-SE --skill code-optimizer -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/code-optimizer, .gemini/skills/code-optimizer, .github/skills/code-optimizer and .opencode/skills/code-optimizer in your project.
Going by SKILL.md and its folder, Code Optimizer needs the command-line tools its instructions call (python, pip and java). Our summary lists: Python 3.
SKILL.md contains no URLs. Its commands use pip, which can reach the network depending on how they are called. This is read from the text; nothing was executed.
Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.
Code Optimizer is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.
About 3.1k tokens (SKILL.md is roughly 13k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.
Skills that share tags, products or a category with Code Optimizer: Django Filter Benchmark (saleor/saleor, 23k stars), Bench Performance (vortex-data/vortex, 3.2k stars), Query Plan Snapshot CLI (eclipse-rdf4j/rdf4j, 420 stars) and BigQuery Slot and Cost Optimizer (google/skills, 21k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.
ArabelaTso (a GitHub user) maintains it in ArabelaTso/Skills-4-SE, which has 253 GitHub stars. The repository holds 150 skills in this directory. The repository was last updated on August 21, 2026.
Source: ArabelaTso/Skills-4-SE on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.