Performance
DataGlass optimizes rendering automatically and provides tools to monitor and diagnose performance issues.
Automatic Optimization
The rendering optimizer classifies datasets by size and applies the appropriate strategy:
| Dataset Size | Strategy | What Happens |
|---|---|---|
| Under 1,000 | Full render | All features enabled, no optimization |
| 1,000 - 10,000 | Aggregate | Groups nearby points, reduces visual complexity |
| 10,000 - 50,000 | Progressive | Renders in chunks, updates display incrementally |
| Over 50,000 | Sample | Uniform sampling to manageable size |
For time series data, DataGlass uses LTTB (Largest Triangle Three Buckets) downsampling to preserve visual shape while reducing points.
You don't configure this—it happens automatically based on your data.
Caching
DataGlass caches at multiple levels:
Data Cache
Parsed data stays in memory. The second render of the same file skips parsing entirely.
Settings:
cacheEnabled- Toggle data caching (default: on)cacheMaxSize- Maximum cached items (default: 100)cacheTTL- Time to live in minutes (default: 30)
URL Cache
Remote data fetches cache responses to reduce network requests.
Settings:
urlCacheEnabled- Toggle URL caching (default: on)urlCacheDuration- Cache duration in minutes (default: 15)
Parse Cache
YAML configurations cache after first parse. Identical configs render faster on repeat.
Performance Monitoring
Track rendering performance across your vault.
Quick Report
Command: Show Performance Report
Displays a notice with:
- Total charts rendered
- Average render time
- Cache hit rate
Detailed Report
Command: Show Detailed Performance Report
Opens a modal with comprehensive metrics:
=== DataGlass Performance Report ===
Summary
-------
Total Renders: 47
Cache Hit Rate: 78%
Avg Render Time: 23ms
Phase Breakdown
---------------
Parse: avg 2ms (p95: 5ms)
Load: avg 8ms (p95: 45ms)
Transform: avg 3ms (p95: 12ms)
Render: avg 10ms (p95: 28ms)
Data Sources
------------
file: avg 5ms (42 loads)
inline: avg 1ms (18 loads)
url: avg 89ms (3 loads, cached: 2)
Slowest Operations
------------------
1. sankey-network.md:12 156ms
2. large-dataset.md:8 89ms
3. api-dashboard.md:24 67msExport Reports
- Export Performance Report as JSON - Machine-readable format
- Export Performance Report as Markdown - Paste into notes
Reset Metrics
Command: Reset Performance Metrics
Clears all collected data. Use after making optimizations to measure improvement.
Optimization Tips
1. Filter Early
Apply filters before other transformations to reduce data volume:
transformations:
- type: filter
configuration:
where: { status: { eq: "active" } }
- type: aggregate
configuration:
groupBy: [category]
sum: [amount]2. Select Only Needed Columns
Drop unused columns to reduce memory:
transformations:
- type: select
configuration:
columns: [date, value, category]3. Pre-aggregate Large Datasets
If your CSV has millions of rows, aggregate in the source file or use sampling:
transformations:
- type: sampling
configuration:
method: random
size: 100004. Use File Data Over URL
Local files load faster than network requests. Download frequently-used API data to your vault.
5. Simplify Complex Charts
Multiple marks, facets, and interactions add overhead. For dashboards with many charts, prefer simpler configurations.
Troubleshooting Slow Charts
- Run Detailed Performance Report - Identify which phase is slow
- Check data size - Large datasets trigger optimization automatically, but may still be slow
- Review transformations - Complex pipelines add overhead
- Verify cache is working - Check hit rate in performance report
- Test with inline data - Rules out file/URL loading issues
Common Issues
| Symptom | Likely Cause | Solution |
|---|---|---|
| Slow first render, fast after | Cold cache | Expected behavior |
| Always slow | Large dataset or complex transforms | Simplify or sample data |
| Slow with URL data | Network latency | Enable caching, download locally |
| Memory warnings | Too much cached data | Reduce cacheMaxSize |