string_decoder: fix performance regression
authorBrian White <mscdex@mscdex.net>
Thu, 11 Feb 2016 15:31:47 +0000 (10:31 -0500)
committerMyles Borins <mborins@us.ibm.com>
Mon, 21 Mar 2016 19:57:54 +0000 (12:57 -0700)
commitcc0e36ff98f7b5b6610bbfeed508c4163673c897
tree97db1e5dd5060e20734b033213eecbc4315e6d6e
parent242a65e9301944b87705efa8987c2d832145baac
string_decoder: fix performance regression

This commit reverts the const usage introduced by 68a6abc
because v8 currently cannot optimize functions that contain
these uses of const (unsupported phi use of const variable).
The performance difference in this case can be up to ~130%
for non-ascii/binary string encodings.

PR-URL: https://github.com/nodejs/node/pull/5134
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: James M Snell <jasnell@gmail.com>
lib/string_decoder.js