News for hackers. Stuff that matters.
Re:Ask HN: What Happened to Borland? by Jtsummers on Friday December 10, 2021 @03:30PM (#29515097)
CPU cycles were also incredibly precious. It's a tradeoff. In the 80s and 90s you also had smaller caches so iterating over a string to determine its length was more expensive (more likely to hit RAM) than "just" reading its length parameter and carrying on with your life.
Re:Ask HN: What Happened to Borland? by yongjik on Friday December 10, 2021 @04:34PM (#29515720)
Sure everything was more expensive, but not by the same factor. Main memory was smaller but also relatively faster compared to CPU. Search for "386 simm memory" and you'll see 60ns modules. Considering that 386 debuted with 12MHz clock, 60 ns is faster than one CPU clock cycle!

In other words, "reading the whole string from memory" could be a performance problem, but a less serious problem for machines of those days, compared to using a few more bytes to store the length.