2 ms·
Many systems used this convention; c was merely one of them. So it was a “choice” more than an”decision”. The Mesa guys at PARC did a study back in the late 7
by gumby 4y ago
Many systems used this convention; c was merely one of them. So it was a “choice” more than an”decision”.
The Mesa guys at PARC did a study back in the late 70s and, statistically, length-marked strings are faster than delimited ones.
Delimited strings have some advantages: they save the space needed to store the length, at the cost of an extra byte (not worth the cost these days); and some substrings can be assembled simply by pointing into the string (of course counted strings can share storage). But at a terrible cost.
But remember that the PDP-7 was less powerful than some AVRs. We use more powerful chips to scan keyboards these days.
- adgjlsfhk1 4y agoYou could pretty easily make it be very low overhead. Store the length of 128 or fewere byte strings with 1 byte for the length (starting with a zero), and if the first bit is a 1, then the string length takes 4 bytes (or use extra bytes with the same format).