4,901 karma · joined Sep 13, 2020 (6y ago) · 1,641 submissions
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
Exactly. From rsc's previous post[1]:
> On my laptop, a C thread switch takes a few microseconds. A channel operation and goroutine switch is an order of magnitude cheaper: a couple hundred nanoseconds. An optimized coroutine system can reduce the cost to tens of nanoseconds or less.
comment 3y ago · link · parent
In primary school I read Jonathan Stroud’s Bartimaeus Sequence (a children’s books trilogy) where this is part of the plot. Knowing someone’s real name allows a magician to cast spells on that person. :)
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
1. Multiple implementations providing a unified interface, selected by the build system. Aka the Henry Spencer approach: <https://www.usenix.org/legacy/publications/library/proceedin...>
2. Less-bad macros, e.g. cond-expand: <https://weinholt.se/articles/cond-expand-and-ifdef/>
comment 3y ago · link · parent
Alcohol: absolutely? How many parents beat their children/spouses under the influence of alcohol, but never sober? How many kill others under the influence while driving?
comment 3y ago · link · parent
[1]: <https://ourworldindata.org/grapher/share-of-adults-who-smoke>
comment 3y ago · link · parent
comment 3y ago · link · parent
Results:
N = 10000
range 1218.1
sentinel 937.258
mine 672.227
ratio 1.29964
(ratio is range/sentinel, not mine/whatever)You can get even more crazy with SIMD. But for all that you need to know the length beforehand.
Edit: The b4 variable should actually be called b8. That's a remnant of a previous version, where I used 32-bit chunks.