This page documents GeoHazardWatch's performance characteristics, known bottlenecks, and optimization strategies.
Server startup time is critical for developer experience and production deployments. The following optimizations have been implemented.
Initial testing with ~2,800 pages revealed significant startup delays:
| Metric | Before | After | Improvement |
|---|---|---|---|
| Total startup time | 48+ seconds | ~3 seconds | 16x faster |
| Link graph build | 54 seconds | 0.15 seconds | 360x faster |
| Page count | 2,834 | 3,225 | (more pages, faster startup) |
All pages were read from disk three separate times during initialization:
| Pass | Component | Purpose | Original Time |
|---|---|---|---|
| 1 | FileSystemProvider.refreshPageList() | Build page cache | ~0.4s |
| 2 | LunrSearchProvider.buildIndex() | Build search index | ~1.5s |
| 3 | RenderingManager.buildLinkGraph() | Build link graph | ~41s |
RenderingManager.buildLinkGraph() exhibited quadratic complexity:
await pageManager.getPage()pageNameMatcher.findMatch() with linear searchAll three passes used a slow sequential pattern instead of parallel operations.
Benchmark results for different read patterns:
| Pattern | Time (2,834 files) |
|---|---|
| Sync reads | 71ms |
| Parallel async | 122ms |
| Sequential async | 268ms |
| Sequential + YAML parse | 411ms |
refreshPageList()src/providers/FileSystemProvider.tsbuildIndex() method for O(1) lookups instead of O(n)src/utils/PageNameMatcher.tsRenderingManager.buildLinkGraph() now uses Promise.all() for parallel loadingawait in loopssrc/managers/RenderingManager.tsgetPage() with getPageMetadata() where only metadata is neededgetPageMetadata() is synchronous and requires no disk I/OWikiRoutes.ts, UserManager.ts, ImportManager.tsPerformance varies significantly based on storage type:
| Storage Type | Per-file latency | Estimated Startup (3 passes) |
|---|---|---|
| Local SSD | 0.03ms | 2-3 seconds |
| NAS (1Gbps) | 2-5ms | 30-60 seconds |
| Cloud (S3) | 50-100ms | 10-15 minutes |
Content caching is particularly important for NAS and cloud storage where per-file latency is high.
The markup parser includes built-in performance monitoring for parsing operations.
{
"amdwiki": {
"markup": {
"performance": {
"monitoring": true,
"alertThresholds": {
"parseTime": 100
}
},
"cache": {
"metricsEnabled": true
}
}
}
}
getPageMetadata() instead of getPage() when only metadata is neededPotential improvements not yet implemented:
For instances with 10,000+ pages: switch to ElasticsearchSearchProvider — persistent indexing means no cold rebuild on restart, and each page save is a single-document upsert rather than a full in-memory rebuild. See Configuration Properties Reference for the config keys.
See also Configuration for configuration options and System Settings for server settings.