dy / xhtm

XHTM − eXtended Hyperscript Tagged Markup
MIT License
25 stars 2 forks source link

Methods chronology #1

Closed dy closed 4 years ago

dy commented 4 years ago

1. functional

2. purely-functional

2.1 purely-functional-fast

indexOf race vs regexp search − no caching :/

3. indexof

! normalize input - get rid of newlines ! indexOf and split are lighting-fast − split is slow, even slower with limitsplit is still faster than manual indexofs with slicewhile, for manual loops are medium (10x slower than natives) − search, match are slower than split3×indexOf is ~20 times faster than regex (no matter precreated or not) − recursion is ~100 times slower than simple while loop :( − simple fn call is not that bad as recursion ! flash-forward by one char (faster and anyways you'd walk the same with htm's each-character-matching strategy) ! clusters-associated knowledge. ! merge i, j into a single numeric coordinate (comparable) ! put fields as private unicodes in a single string. ✔ no recursion − field placeholder

4. [htm boosted]()

5. Iterative reactor

~ unicode and back conversion creates unnecessary slow down and bloated code, bringing it to 590kb. Ideal structure seems to be a meta-path, walked by the depth of modes (modes are indeed related by semantic depth).

6. Metamodes

8. Regex

dy commented 4 years ago

Clusters

<tag${'name'}.possibly${multi}#cluster
  param${'name'}cluster=${'value'}c${'l'}uster
  quoted="${'cluster'} ${'with'} ${null} > ${false}"
  route=/${'cluster'}/too
  ${'anonymous'}param
  ...${{ spread: 'cluster' }}>
  And ${'text'} clusters ${'too'} <${'with'}>nested</> tags
</>