4 ms·
Computers are astonishingly fast at summing integers.
by inopinatus 3y ago
Computers are astonishingly fast at summing integers.
- epcoa 3y agoThey are not comparably astonishingly fast at retrieving that data.
- inopinatus 3y agoAccounting data is so compact that the word “comparably” is doing all the heavy lifting in that statement. A large accounting system certainly prefers to have large main memory, but even in the worst case scenario, we read from persistent storage at GB/sec and the processor has no trouble keeping up. You don’t have to get particularly smart to operate a billion-row ledger; only beyond that does it start to be interesting.
- thfuran 3y agoThey're pretty fast, but if everyone writes software that does 10,000x more computation than necessary on that basis, suddenly they're slow.
- inopinatus 3y ago“If everyone is incompetent, all software will be bad”. Got it, thanks.
- thfuran 3y agoYou were the one advocating for incompetence.
- inopinatus 3y agoThat was not the incredible burn you hoped for, because it kinda suggests a lack of consideration for the practical design of a modern computer, in which memory is tiered in orders of magnitude of time latency from CPU registers on down through on-die caches and so forth, each tier effectively acting as a local cache for the next level. Writes are super expensive and bust cache lines and coherency all the way down to main memory and in many applications touch persistent storage and even introduce network latencies in distributed systems. By contrast, ALUs are stupendously well optimized for the baseline computational task of adding up integers. The difference between nanoseconds and milliseconds is vast. It is consequently very often cheaper to recalculate a sum using data already in cache memory than to save it and later fetch it, or (even worse) to read a value precalculated by a neighbouring computer. Furthermore, the distinction only matters for accounting systems at high scale. For the average small business accounting, it is de minimis: your computer performs more computation when resizing a browser window than it does in recalculating an account balance from scratch.
- thfuran 3y agoYou're supposing that the whole transaction history is for some reason already in L1? Sure, in that case the extra burden of crunching some numbers is mostly irrelevant because there's almost no data and you've already paid for it. But you probably shouldn't have.