I was looking at some code (https://github.com/einaros/tinycolor/blob/master/tinycolor.js) that adds to the prototype of the String
object in javascript.
I was wondering how to assume the overhead of adding to the String
prototype, as it applies to any string handling (cpu, memory) that doesn't require these additions. That's because I probably wouldn't find it useful to get overhead for all string manipulations just for this small shim, and I guess it's also a good time to get more friendly with javascript prototype manipulation of the native types.
As the topic has been endlessly discussed in various contexts, any pointer to an existing good or simple analysis would be helpful, or a succinct-yet-correct explanation. It's a bit hard to land using a Google keyword search..
Thanks!