twolfson / trunkata

Truncation utility which preserves HTML content and can truncate by lines.
MIT License
2 stars 3 forks source link

Add in performance tests #6

Open twolfson opened 11 years ago

twolfson commented 11 years ago

We are doing linear searches everywhere and testing against mainly text content. We should add in some performance tests and cross-browser thresholds with real data.

twolfson commented 11 years ago

If we need performance boosts, use a binary search node_module. There are some other TODO notes of interest:

// TODO: Find out how many words we have and treat it as a linear array

// TODO: Optimization, create a map of when each child starts in the word map so we can jump to them faster

// In the context of depth-first traversal

// TODO: Go to the last descedendant (all the way down the tree) of the last child, start breaking off words, if none removed there, then go up to next child

twolfson commented 11 years ago

Perform binary search in nodeValue section.