That might have been a reasonable statement 3 years ago, but today there is a global crisis caused by extremely high RAM prices. Optimize your blasted code.
I’m talking about the *code* wasting memory. In JavaScript each function is a heap object and its source code is another heap object. Even if a JIT compiler inlines them, the original non-inlined functions keep sitting there wasting perfectly good bytes.
and again, you end up sacrificing readability to address what, a fraction of a percent in memory use? If that matters in your program, maybe don’t use JS.
this sounds like a pretty bad reason to justify ugly code today
any readability gain will greatly outweight resources in most situations
@eager_eagle
That might have been a reasonable statement 3 years ago, but today there is a global crisis caused by extremely high RAM prices. Optimize your blasted code.
Agreed, optimize it. Where it matters. Reducing the number of functions to save space on the stack when the heap has 99% of the data is nonsense.
@eager_eagle
I’m talking about the *code* wasting memory. In JavaScript each function is a heap object and its source code is another heap object. Even if a JIT compiler inlines them, the original non-inlined functions keep sitting there wasting perfectly good bytes.
and again, you end up sacrificing readability to address what, a fraction of a percent in memory use? If that matters in your program, maybe don’t use JS.