Quick Performance Wins
1. Plan Ahead with Observe
Use a singleobserve()
call to plan multiple actions, then execute them efficiently:
Performance Tip: Acting on
observe
results avoids LLM inference entirely. This approach is 2-3x faster than direct act()
calls and is the recommended pattern for multi-step workflows.Caching Guide
Learn advanced caching patterns and cache invalidation strategies
2. Optimize DOM Processing
Reduce DOM complexity before Stagehand processes the page:3. Set Appropriate Timeouts
Use shorter timeouts for simple operations and longer ones for complex page loads:Advanced Performance Strategies
Smart Model Selection
Use faster models for simple tasks, premium models only when needed:Model Configuration
Compare model performance and costs
Page Load Optimization
Skip unnecessary resources during page loads:Cost Optimization
Balance speed with cost considerations