spark-optimization
Skill0 starsChanged 10 months agoMITView on GitHub
Specialist in Apache Spark performance optimization—partitioning strategies, memory tuning, shuffle reduction, and job profiling for production systems. Use when optimizing Spark jobs, tuning performance, reducing costs, profiling applications, or scaling Spark workloads.
8 other projects use a version of this, 7 of them edited.
Adopted by
Most recently taken up by
- ControllableModel/SWE-Skills-Benchedited, first seen Nov 8, 2026
- KumailQazi/krmaazha-binance-mcpedited, first seen Oct 17, 2026
- xfstudio/skillsedited, first seen Oct 13, 2026
- Samueladewole/claude-skillsedited, first seen Oct 13, 2026
- xiangu152/my_claude_skillstheir own version, first seen Apr 5, 2026
- ai4brands-design/claude-skillsedited, first seen Mar 22, 2026
Other versions8 projects use a version of this.
Word for word · 0
None found.
Edited · 7
- xfstudio/skills★ 915% same
- ControllableModel/SWE-Skills-Bench★ 815% same
- KumailQazi/krmaazha-binance-mcp★ 426% same
- ai4brands-design/claude-skills★ 215% same
- bcastelino/agent-skills-kit★ 215% same
- CodeWithBehnam/cc-docs★ 213% same
- Samueladewole/claude-skills★ 015% same
Wrote their own version · 1
- xiangu152/my_claude_skills★ 2same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository33 other files it gives its agents.
- architectSkill
- brainstormingSkill
- concise-planningSkill
- context-engineerSkill
- data-deprecation-analysisSkill
- data-modelerSkill
- data-pipeline-engineerSkill
- data-quality-frameworksSkill
- dbt-transformation-patternsSkill
- github-workflow-automationSkill
- guardianSkill
- implementerSkill
- json-to-pydanticSkill
- llm-app-patternsSkill
- navigatorSkill
- ops-managerSkill
- orchestratorSkill
- principal-data-engineerSkill
- product-manager-toolkitSkill
- proj-memorySkill
- prompt-librarySkill
- qa-testerSkill
- researcherSkill
- senior-data-engineerSkill
- software-architectureSkill
- sql-optimization-patternsSkill
- state-managerSkill
- subagent-driven-developmentSkill
- thinkerSkill
- top-web-vulnerabilitiesSkill
- verification-before-completionSkill
- web-design-guidelinesSkill
- workflow-managerSkill
The file
We split this skill into the rules it gives an agent
5 rules. 0 are common, 5 are distinctive, and 0 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 23
Use this skill when:
- Distinctive: line 33
Performance Profiling: Read Spark UI, identify bottlenecks (shuffle, GC, serialization, I/O)
- Distinctive: line 52
Check for data skew (uneven task durations)
- Distinctive: line 65
Test with production data volume and characteristics
- Distinctive: line 67
Document optimization in runbook for future engineers
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
- performance
- distributed-computing
Spark Optimization - Performance Tuning
Overview
The Spark Optimization skill focuses on diagnosing and fixing performance bottlenecks in Apache Spark jobs. This is a specialized, deep-focus skill for when you have a Spark job that's slow, consuming too much memory, or not scaling efficiently.
Use this skill when:
- A Spark job exceeds its SLA or budget
- You need to debug why a job is slower than expected
- You're optimizing for large-scale data processing
- Shuffles, skew, or memory pressure are causing failures
- You need to choose between partitioning strategies or join algorithms
Core Capabilities
- Performance Profiling: Read Spark UI, identify bottlenecks (shuffle, GC, serialization, I/O)
- Partitioning Optimization: Right-size partitions, implement skew handling, partition pruning
- Join Optimization: Choose between broadcast, sort-merge, and bucket joins based on data characteristics
- Memory Tuning: Optimize executor memory, cache strategy, and GC behavior
- Serialization: Configure Kryo, choose columnar formats for large data
- Caching Strategy: Identify what to cache, when to cache, and when to spill
When to Use
Workflow / Process
Phase 1: Diagnosis
- Enable Spark UI and run job to completion
- Analyze executor usage, task durations, and shuffle size
- Identify bottleneck: CPU, memory, I/O, or scheduling
Phase 2: Root Cause Analysis
- Check for data skew (uneven task durations)
- Review join strategy (broadcast vs sort-merge vs bucket)
- Analyze partition count and size
- Evaluate serialization and format choices
Phase 3: Optimization
- Apply targeted fix (e.g., repartition, broadcast join, caching)
- Measure impact: runtime, memory, cost
- Iterate if improvements insufficient
Phase 4: Validation
- Test with production data volume and characteristics
- Monitor side effects (new bottlenecks, memory pressure)
- Document optimization in runbook for future engineers
Constraints
Technical Constraints:
- Cannot fundamentally change data or algorithm (that's architect/pipeline-engineer role)
- Optimizations must not sacrifice correctness or data consistency
Scope Constraints:
- In Scope: Spark configuration tuning, query optimization, serialization, caching strategy
- Out of Scope: Infrastructure provisioning, algorithm redesign, non-Spark systems
Reference Examples
See examples/ directory for:
- Partitioning strategies and skew handling
- Join algorithm comparisons (broadcast, sort-merge, bucket)
- Memory tuning and caching patterns
- Serialization and format optimization
- Detailed Spark UI analysis walkthroughs
Version History:
1.0 (2026-01-24): Spark-focused optimization skill
skew_ratio = stats["max"] / stats["avg"] print(f"Skew ratio: {skew_ratio:.2f}x (>2x indicates skew)")
## Configuration Cheat Sheet
```python
# Production configuration template
spark_configs = {
# Adaptive Query Execution (AQE)
"spark.sql.adaptive.enabled": "true",
"spark.sql.adaptive.coalescePartitions.enabled": "true",
"spark.sql.adaptive.skewJoin.enabled": "true",
# Memory
"spark.executor.memory": "8g",
"spark.executor.memoryOverhead": "2g",
"spark.memory.fraction": "0.6",
"spark.memory.storageFraction": "0.5",
# Parallelism
"spark.sql.shuffle.partitions": "200",
"spark.default.parallelism": "200",
# Serialization
"spark.serializer": "org.apache.spark.serializer.KryoSerializer",
"spark.sql.execution.arrow.pyspark.enabled": "true",
# Compression
"spark.io.compression.codec": "lz4",
"spark.shuffle.compress": "true",
# Broadcast
"spark.sql.autoBroadcastJoinThreshold": "50MB",
# File handling
"spark.sql.files.maxPartitionBytes": "128MB",
"spark.sql.files.openCostInBytes": "4MB",
}Best Practices
Do's
- Enable AQE - Adaptive query execution handles many issues
- Use Parquet/Delta - Columnar formats with compression
- Broadcast small tables - Avoid shuffle for small joins
- Monitor Spark UI - Check for skew, spills, GC
- Right-size partitions - 128MB - 256MB per partition
Don'ts
- Don't collect large data - Keep data distributed
- Don't use UDFs unnecessarily - Use built-in functions
- Don't over-cache - Memory is limited
- Don't ignore data skew - It dominates job time
- Don't use
.count()for existence - Use.take(1)or.isEmpty()
Resources
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

