apache/hamilton/scale
- community
Checking that the SKILL.md file is still in the repository.
Performance and parallelization patterns for Hamilton including async I/O, Spark, Ray, Dask, caching, and multithreading. Use for scaling Hamilton workflows.
Install
npx vskill@latest install apache/hamilton/scaleSKILL.md
Hamilton Scaling & Performance
This skill covers parallelization strategies and performance optimization for Apache Hamilton workflows.
When to Scale
Choose your scaling strategy based on workload:
- Async: I/O-bound operations (API calls, database queries)
- MultiThreading: Synchronous I/O (legacy APIs without async support)
- Spark: Large datasets (multi-GB to multi-TB) on clusters
- Ray/Dask: Distributed Python computation
- Caching: Avoid redundant expensive computations
Async Execution for I/O-Bound Workflows
When to Use:
- API calls (LLM providers, REST APIs, GraphQL)
- Database queries (async ORM operations)
- Dependent chains of I/O-bound calls
- Multiple parallel external service calls
Key Benefits:
- Automatic parallelization of independent async operations
- Natural expression of dependent chains
- Mix async and sync functions in the same DAG
- Significantly faster than sequential execution
Basic Async Pattern:
Parallel I/O Operations:
MultiThreading for Sync I/O
For synchronous I/O-bound code (legacy APIs, blocking libraries):
When to Use:
- Synchronous I/O code (requests library, blocking DB drivers)
- Legacy APIs without async support
- Simple parallelization without code rewrite
Scaling with Apache Spark
When to Use Spark:
- Dataset size exceeds single-machine memory (multi-GB to multi-TB)
- You have access to a Spark cluster
- Need distributed data processing
Basic PySpark Pattern:
Column-Level Transformations with @with_columns:
Spark Best Practices:
- Keep transformations lazy - Don't call
.collect()until final nodes - Use
@with_columnsfor map operations - Partition wisely between major operations
- Cache DataFrames accessed multiple times
- Test with small data first (
.limit(1000))
Ray for Distributed Python
When to Use Ray:
- Distributed Python computation
- Machine learning workloads
- Custom parallelization logic
Dask for Parallel Computing
When to Use Dask:
- Pandas-like operations on larger-than-memory datasets
- Parallel computation on single machine or cluster
- Incremental migration from pandas
Caching for Performance
When to Use Caching:
- Expensive API calls (LLM inference, external services)
- Time-consuming data processing
- Iterative development in notebooks
- Shared preprocessing between pipelines
Basic Caching Setup:
Controlling Cache Behavior:
Driver-Level Cache Control:
Cache Inspection:
Choosing the Right Scaling Strategy
Decision Matrix:
| Workload Type | Strategy | Use When | |
|---|---|---|---|
| I/O-bound (async-capable) | AsyncDriver | Multiple API calls, async libraries available | |
| I/O-bound (sync only) | MultiThreading | Legacy APIs, blocking I/O | |
| Large datasets | Spark | Multi-GB/TB data, cluster available | |
| Python computation | Ray/Dask | Custom parallel logic, ML workloads | |
| Expensive operations | Caching | Repeated computations, LLM calls |
Combining Strategies:
- Cache + Async = Cache expensive API calls, parallelize independent calls
- Spark + Caching = Cache intermediate Spark results
- Ray + Caching = Distribute computation, cache results
Performance Tips
- Profile first - Identify bottlenecks before optimizing
- Start simple - Begin with caching, add parallelization if needed
- Measure impact - Benchmark before and after changes
- Consider costs - Serialization overhead can negate parallelization benefits
- Test at scale - Small data may hide parallelization overhead
Additional Resources
- For basic Hamilton patterns, use
/hamilton-core - For LLM-specific workflows, use
/hamilton-llm - Apache Hamilton docs: hamilton.apache.org/concepts/parallel-task
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.claude-plugin/skills/scale/SKILL.md
Popularity
- Repository stars
- 2,546
- Repository forks
- 198
- 7-day trend score
- 39
Stars and forks are for the whole GitHub repository, not this skill alone. Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/apache/hamilton/scale)