This guide covers strategies for making Figranium tasks faster, more efficient, and more reliable at scale.Documentation Index
Fetch the complete documentation index at: https://figranium.dev/docs/llms.txt
Use this file to discover all available pages before exploring further.
Understanding Execution Time
A typical task execution involves:- Browser launch: ~1–3 seconds (includes Playwright startup and stealth plugin initialization)
- Navigation: ~0.5–5 seconds depending on the page
- Actions: Variable (clicks, types, waits)
- Extraction: ~0.1–1 second
Reduce Unnecessary Waits
Replace fixed waits with conditional waits
Instead of waiting a fixed time:Use realistic minimum waits
For stealth purposes, some wait time is necessary. But 500ms is usually sufficient to appear human. Avoid blanket 3000ms waits unless the site specifically requires them.Optimize Selector Performance
Broad selectors require more DOM traversal:- ID selectors (
#element-id) — O(1) lookup by the browser - Attribute selectors (
[data-id="123"]) — indexed in modern browsers - Short class chains over deep descendant paths
Minimize Page Navigations
Eachnavigate action waits for the page to fully load. If you can extract all data from a single page (e.g., using JavaScript to process an API response already in the DOM), do so.
Use in-page API calls instead of navigating:
Foreach loop optimization
Figranium automatically optimizesforeach loops based on which loop variables you use. If your loop body does not reference {$loop.html}, the engine skips fetching the inner HTML of each element, which significantly reduces serialization overhead.
This means simple text-based loops are fast by default:
{$loop.html}, the full HTML is still available as expected — no changes are needed.
Large result previews
The table view in the results drawer previews up to 200 rows of extracted data (CSV, JSON arrays, or nested arrays). This keeps the UI responsive even when your extraction returns tens of thousands of rows. The full dataset is still available through Export and Copy Full — only the in-editor preview is capped. If you are working with very large extractions and notice slow rendering, switch from the Table tab to Raw for a lightweight text view.Batch extraction
For maximum performance when extracting structured data, collect all data in one JavaScript block rather than iterating withforeach + individual JavaScript calls:
Stateless vs Stateful Execution
- Stateful (default): Skips login if cookies are still valid. Faster for repeated runs of tasks requiring authentication.
- Stateless: Slightly slower per run because it authenticates from scratch. Use only when isolation is required.
Proxy and Network Performance
Proxies add latency. Minimize proxy-related slowdowns:- Use geographically nearby proxies when possible.
- Use residential proxies only when required for stealth. For internal or unprotected sites, skip the proxy entirely.
- Set a proxy default rather than rotating on every request if consistency matters more than IP diversity.
Resource Management
Execution History
Figranium stores execution records indata/executions.json (or in PostgreSQL). Over time, this file can grow large and slow down the dashboard.
- Set up a periodic cleanup: Settings > Data > Clear Execution History.
- Use the REST API to automate cleanup:
Screenshot and Recording Cleanup
Recordings (video files) can be large. Regularly purge them:- Settings > Data > Clear Screenshots & Recordings
- Or via API:
POST /api/clear-screenshots
PostgreSQL for Scale
For high-volume deployments with many concurrent tasks or large execution histories, switch from file-based storage to PostgreSQL:Task Design for Reliability
Performance and reliability go hand-in-hand. A task that fails and restarts wastes more time than one that completes slightly slower.- Build in error handling: Wrap optional interactions in
on_error/endblocks. See Error Handling. - Use
wait_selectorover fixed waits: More reliable and faster. - Test on slow network: Use browser DevTools throttling to verify your selectors and waits work under slow conditions before deploying.
- Keep tasks focused: Large monolithic tasks are harder to debug. Break them into smaller, modular workflows. See Modular Workflows.
Docker Resource Allocation
For production deployments, allocate adequate resources indocker-compose.yml:
Headless vs. Headful Performance
Headless mode (default) is significantly faster than headful mode because it skips rendering the browser UI. Only use headful mode for:- Debugging tasks during development
- Sites that specifically require a visible browser to bypass detection