A Note on Editor Performance

Martin Middel
@dr_rataplan

 & 

Stef Busking
@bwrrp

Fonto

What is Fonto?

  • Schema experience
  • Operations
  • User interface

What is performance?

  • Configuration lookups and queries
  • Validation
  • UI responsiveness
  • Sensitivity to configuration / document size

Accessing configuration

configureAsBlock(sxModule, 'self::p');
Property Value
Ignored for navigation false
Splittable true
Layout type block
Render as Block template
... ...

Orthogonal configuration

configureAsBlock(sxModule, 'self::p');
configureAsBlock(sxModule, 'self::p[@align="right"]', {
	align: 'right'
});
configureProperties(sxModule, 'self::p[@align="right"]', {
	align: 'right'
});

Selector buckets

Selector Bucket
self::p name-p
self::element() type-1
self::p or self::div type-1

Order of evaluation

Results

Amount of XPaths evaluated
Without the Bayesian predictor 121 575
With the Bayesian predictor 109 964

Results

Selector without with
self::label

79

2 ms

1 662

47 ms

self::label[parent::abstract]

79

3 ms

1

(Too low to measure)

self::label[parent::fn]

1 733

60 ms

1 091

42 ms

self::named-content[@vocab="unit-category"] 2 173 160 ms 1 174 96 ms
self::named-content[@vocab="specification"]

325

22 ms

538

56 ms

Processing XML

XPath performance

  • Lazy evaluation
  • Outermost
  • Buckets as cheap early fail
descendant-or-self::li[1]
descendant-or-self::li => outermost()

XML Validation

  • NFA
  • Offline pre-processing
  • un-JavaScript-like optimizations

Indices - DOM

  • Attribute index
    /descendant-or-self::*[@id=$value]
  • Bucket index
    /descendant-or-self::fn
  • Descendant index
    $node/descendant::li

Indices - arbitrary computations

  • Dependency tracking
  • Caching & invalidation
  • Optimizations

Related work

  • XSLT
  • XML databases

The end?

  • Many tricks possible
  • Browser-based XML processing can be fast
  • Lots more to do...

Questions

@dr_rataplan / @bwrrp

@fontoxml