3 ms·
For some microcomputer basics that was true, as they implemented the 'find that line' part of goto and gosub by a linear search from the start of the program, s
by Someone 9y ago
For some microcomputer basics that was true, as they implemented the 'find that line' part of goto and gosub by a linear search from the start of the program, skipping from line to line.
Having fewer lines, or having the most often called routines at the start of the program would speed up programs, potentially a lot.
- taneq 9y agoAlso various constrained environments (calculators and whatnot) where variables were significantly faster to access if they were declared locally than if they were global, or were faster if the name was shorter, etc. Not to mention the simple fact that, for old interpreted languages, the entire program text had to fit inside memory and so terseness literally saved you working memory.
- nerdponx 9y agoIn CPython, local function calls are still much faster than global function calls.
- blattimwind 9y agoSimilarly, in CPython function-local variables are faster to access than class or module attributes (with the usual bunch of exceptions you always have in Python). This probably applies to similar languages (like Ruby) as well.
- supergreg 9y agoI've seen people recommend shorter names for MongoDB keys for faster querying.
- warrenm 9y agoIn C64 BASIC, iirc, only the first two characters of the [case-insensitive] variable name mattered - so "vacuum" and "vacation" were the same, since the 'real' variable name was "va"