Skip to content

micromark-util-subtokenize results in high cpu costs and memory allocations #115

Answered by wooorm
starpit asked this question in General
Discussion options

You must be logged in to vote

I am not sure the overhead of a linked list or similar will be that much faster.
Yes, a lot of time is spent merging things together; it might be needed to spend time on something similar to it.

You are welcome to test it out while working on a PR though.
It will mean a giant breaking change of everything though. Every package, every extension, deeply depends on simple arrays.

Perhaps there is an alternative. I have recently noted that a following approach can help speed it up a lot:

  • Split events off from the end if an array, from the end backwards to the start, pushing each existing slice into an array, also pushing new slices to that array
  • Append each slice to the array

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ChristianMurphy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants