pgriess / node-strtok

A streaming tokenizer library for NodeJS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Do not create a new Buffer each we find a type that span buffers

pgriess opened this issue · comments

Whenever strtok,parse.emitData() is looking for some number of contiguous bytes, it allocates a new Buffer object to hold them. This allocation is expensive. Instead, we should re-use a single global Buffer instance, growing it as necessary.

Keep a glogal buffer for types that span buffers.

Closed by d6178bf.

  • Resize our static buffer if the current type requires more space.