Performance Optimization

Last modified: 2/11/2026

Performance Optimization

This page documents GeoHazardWatch's performance characteristics, known bottlenecks, and optimization strategies.

Server Startup Performance

Server startup time is critical for developer experience and production deployments. The following optimizations have been implemented.

Baseline Measurements

Initial testing with ~2,800 pages revealed significant startup delays:

MetricBeforeAfterImprovement
Total startup time48+ seconds~3 seconds16x faster
Link graph build54 seconds0.15 seconds360x faster
Page count2,8343,225(more pages, faster startup)

Root Causes Identified

Triple Page Scan on Startup

All pages were read from disk three separate times during initialization:

PassComponentPurposeOriginal Time
1FileSystemProvider.refreshPageList()Build page cache~0.4s
2LunrSearchProvider.buildIndex()Build search index~1.5s
3RenderingManager.buildLinkGraph()Build link graph~41s

RenderingManager.buildLinkGraph() exhibited quadratic complexity:

Sequential Async Reads

All three passes used a slow sequential pattern instead of parallel operations.

Benchmark results for different read patterns:

PatternTime (2,834 files)
Sync reads71ms
Parallel async122ms
Sequential async268ms
Sequential + YAML parse411ms

Optimizations Implemented

Content Caching in FileSystemProvider

PageNameMatcher Index

Parallel Page Loading

Metadata-Only Operations

Storage Performance

Performance varies significantly based on storage type:

Storage TypePer-file latencyEstimated Startup (3 passes)
Local SSD0.03ms2-3 seconds
NAS (1Gbps)2-5ms30-60 seconds
Cloud (S3)50-100ms10-15 minutes

Content caching is particularly important for NAS and cloud storage where per-file latency is high.

Markup Parser Performance

The markup parser includes built-in performance monitoring for parsing operations.

Configuration Options

{
  "amdwiki": {
    "markup": {
      "performance": {
        "monitoring": true,
        "alertThresholds": {
          "parseTime": 100
        }
      },
      "cache": {
        "metricsEnabled": true
      }
    }
  }
}

Available Metrics

Best Practices

Future Optimizations

Potential 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.