Skip to content

v0.6.0

Latest
Compare
Choose a tag to compare
@mathiasbynens mathiasbynens released this 23 Apr 14:13
· 124 commits to main since this release

Regenerate v0.6.0 is much more memory-efficient and faster than v0.5.4. Internally, it was completely rewritten based on a new data structure to store the set of code points in. As a result, the code is not as readable as it used to be, but the performance improvement is worth it. Here’s an example, where I ran https://gist.github.com/mathiasbynens/6334847 using both versions:

$ time node javascript-identifier-regex.js > /dev/null # using Regenerate v0.5.4

real    0m5.867s
user    0m5.837s
sys 0m0.077s

$ time node javascript-identifier-regex.js > /dev/null # using Regenerate v0.6.0

real    0m0.440s
user    0m0.419s
sys 0m0.023s

API changes

  • The non-chaining API has been removed. Use the chaining API instead.
  • New method: regenerate.prototype.clone().
  • More single-character escape sequences are now used, resulting in more compact output.
  • Methods are now exposed on regenerate.prototype, which enables you to create your own Regenerate plugins. See #20 for an example.
  • add, remove, difference, and intersection now accept other Regenerate instances as arguments.