Skip to content

Latest commit

 

History

History
219 lines (159 loc) · 6.02 KB

File metadata and controls

219 lines (159 loc) · 6.02 KB

MDLD Performance

Testing Methodology

Environment

  • Hardware: MacBook Pro M1
  • Node.js: v24.7.0
  • Method: Median of multiple runs, warmed-up parser
  • Data: Synthetic and real-world ontologies

Test Types

  1. Synthetic Scaling - Precise quad count testing
  2. Real-World Ontologies - PROV-O, RDF+RDFS, SHACL
  3. Binary Search - Exact limit determination
  4. Conservative Limits - 95% confidence with 10% safety margin

Grounded Performance Numbers

Key Metrics

Metric Value Use Case
60fps Frame 4,527 quads Interactive knowledge graphs
1-Second Batch 225,059 quads Background reindexing, imports
Sustained Rate 252K quads/sec Continuous processing

Real-World Efficiency

Document Type Quads Size (KB) Quads/sec
PROV-O 944 141 27,505
RDF+RDFS 231 39 36,903
SHACL 286 109 23,692
Mixed Set 1,461 288 51,684

Scaling Characteristics

60fps Performance

Scale Quads Parse Time Status
Conservative Limit 4,527 16.12ms ✅ 96.7% budget
Maximum Limit 5,031 19.15ms ❌ Exceeds budget
Real-World Sets 4,383 115.28ms ❌ 87.1% efficiency

1-Second Performance

Scale Quads Parse Time Status
Conservative Limit 225,059 890ms ✅ 89.0% budget
Maximum Limit 250,066 990ms ✅ Within budget
Real-World Sets 249,831 6088ms ✅ 99.9% efficiency

Enterprise Scaling

Document Collection Limits

Enterprise Size Total Quads Ontology Sets Parse Time Architecture
Small 7,602 3 147ms Full reparse OK
Medium 28,670 19 647ms Background reparse
Large 72,830 49 1,461ms Incremental only

Documents Per Second

Document Type Parses/sec Quads/sec
PROV-O 60 27,505
RDF+RDFS 349 36,903
SHACL 153 23,692
Mixed Set 35 51,684

Performance Optimization

Character-Based Tokenization

Improvement: 20-28% faster than regex-based approaches

Techniques:

  • Direct character inspection
  • No regex engine overhead
  • Predictable O(n) complexity
  • Memory-efficient state tracking

Memory Management

Characteristics:

  • ~640 bytes per quad after GC
  • Streaming-friendly single-pass
  • No full document copies
  • Efficient indexing structures

Incremental Updates

Performance:

  • <5ms per ontology addition
  • O(new) complexity
  • Real-time capable for <4K quads
  • Background processing for larger sets

Test Results

Binary Search Results

60fps Target: 16.67ms
├── Conservative: 4,527 quads @ 16.12ms (96.7% budget)
└── Maximum: 5,031 quads @ 19.15ms (exceeds budget)

1-Second Target: 1000ms  
├── Conservative: 225,059 quads @ 890ms (89.0% budget)
└── Maximum: 250,066 quads @ 990ms (within budget)

Real-World vs Synthetic

Metric Synthetic Real-World Efficiency
60fps Quads 5,031 4,383 87.1%
1-Sec Quads 250,066 249,831 99.9%
Parse Rate 252K/sec 51K/sec 20.2%

Usage Recommendations

Real-Time Applications (60fps)

Requirements:

  • Document size: ≤4K quads
  • Update pattern: Incremental only
  • Use case: Interactive knowledge graphs

Architecture:

  • Incremental updates
  • Pre-built indexes
  • Background indexing for larger sets

Batch Processing (1-Second)

Requirements:

  • Document size: ≤225K quads
  • Update pattern: Full reparse
  • Use case: Background reindexing, imports

Architecture:

  • Worker thread processing
  • Chunked processing for >50MB
  • Progress reporting

Enterprise Knowledge Bases

Scale Guidelines:

  • Small (<4K quads): Real-time updates
  • Medium (4-225K quads): Batch reindexing
  • Large (>225K quads): Streaming architecture

Best Practices:

  • Use incremental updates for real-time
  • Batch process during maintenance windows
  • Implement streaming for large corpora

Performance Monitoring

Built-in Metrics

The parser includes performance monitoring:

  • Parse time measurement
  • Memory usage tracking
  • Quad count statistics
  • Error rate monitoring

Benchmarking Tools

Available Tests:

  • load-test-grounded-numbers.js - Exact limit determination
  • load-test-real-ontologies.js - Real-world performance
  • load-test-60fps-scale.js - Interactive performance
  • load-test-knowledge-workbench.js - Enterprise simulation

Performance Regression Testing

Method:

  • Automated performance benchmarks
  • CI/CD integration
  • Alert on >10% performance degradation
  • Historical trend tracking

Architectural Implications

Real-Time Capabilities

✅ Interactive UI: Up to 4K quads with 60fps updates
✅ Background Processing: Up to 225K quads per second
✅ Enterprise Scale: 154 ontology sets per reparse
❌ Full UI Reparse: Not viable beyond 4K quads

Design Patterns

Incremental Architecture:

  • Stream updates as they arrive
  • Maintain pre-built indexes
  • Use background workers for bulk operations

Batch Architecture:

  • Process documents in chunks
  • Use worker threads
  • Implement progress reporting

Streaming Architecture:

  • Process large corpora incrementally
  • Use memory-efficient streaming
  • Implement checkpointing

Bottom Line

MDLD delivers enterprise-scale performance with 252K quads/sec sustained throughput and real-time capabilities for interactive applications. The character-based tokenizer provides significant performance advantages while maintaining clean, maintainable code architecture.

Key Takeaway: MDLD can reliably process 4K quads at 60fps and 225K quads per second, making it suitable for both real-time interactive applications and large-scale knowledge management systems.