Open
Description
for util/cast.js
static toString (value) {
return typeof value === 'string' ? value : String(value);
}
is approx. 7x faster. This function is called in many places, so it's good to boost performance a bit.
Cast.toString 100 * 1000000
average: 10.880438989773392
min: 9.057298995554447
max: 22.80450100451708
OldCast.toString 100 * 1000000
average: 74.98821302987635
min: 68.54039999842644
max: 187.1899999976158