dr2chase
That loses timeliness, adds problem of queue management.
A weird trick I stumbled across years ago is to not strictly pop from the head of the stack/queue -- instead choose randomly from the last N elements of push end of the stack. This seemed to blunt the sort of growth that you get from "visiting wrong". I never did figure out the theory of why this worked.
Two of the "conversion" methods between int and uint vectors compiled to movd or less (but the convert from int to float32 vector does not) and are actually identical to corresponding zero-cost reshapes.
Conversion between int vectors and masks may be zero-cost; it depends on the platform (zero cost on Wasm, NEON, AVX, AVX2; change in representation on AVX512 and SVE).
There's also pattern-based optimization going on in the backend of the compiler, so if (on AVX512 or SVE) you do some operation followed by an IfElse, odds are pretty good the two "methods" will compile down to a single instruction. We did this API factoring so that we could support (many) fewer methods, and it also increases the similarity between different platforms.
SVE and RVV, because they are "scalable", may end up with a larger amount of replication.
Go uses fixed-size stack frames, so spill space is fixed size, etc. We could "just" fix this limitation, or we could generate multiple sizes for what actually exists in the wild, with a masked implementation for longer. So, SVE would end up with 0 (emulation), 128, 256, and 512-masked, plus (as arm64) would also have NEON and NEON-noclmul (Raspberry Pi). I'm not sure what sizes exist for RVV.
But does a vehicle with several people in it pay for the max, min, median, average, or the driver's time? I suspect "driver" is easiest, it seems like it might work but I'll bet there are some screwy ways to game that rule, too.
There have been more academic studies. e.g. https://nacto.org/wp-content/uploads/5_Zhou-Xu-Wang-and-Shen... estimates 2512 bicycles per hour per meter of road width, or 7536 bikes per hour on a 3-meter (10 feet) wide lane. That's only 4.2x car throughput, versus those kids who managed 5.5x.
You are right about the trailers, but at least where I ride, they are not common-case for carrying things, lots more cargo bikes instead, and those are "better" than trailers -- it's possible to ride two cargo bikes side-by-side even in a US protected lane (specifically on Garden Street in Cambridge, MA), though this of course assumes competent riders.
After the change, escape analysis figures out if the changed iteration variable actually needs heap allocation; in an internal sample of code that was actually buggy (i.e., biased, guaranteed to have at least one loop like this) for 5/6 of the loops escape analysis decided that heap allocation wasn't needed.
The reason this optimization isn't part of the language change proposal is that escape analysis is "behind the curtain"; ignoring performance, a program should behave the same with or without it, and it is removing heap allocations all over the place already. Escape analysis is also extremely difficult to explain exactly, so you would not want it in the spec, and "make escape analysis better" (that is, change it) is one of the prominent items in the bag of things to do for Go.
Third, economic arguments are a little dicey for driving because driving is filled with externalized costs, subsidies, overoptimistic assumptions, and dependent utility. Driving creates noise and pollution (and it appears that the pollution is more deadly than crashes) but drivers don't pay that cost. There's personal crash risk, but people tend to assume that they are careful drivers and hence less likely to crash than the norm. The cost of the roads themselves is currently subsidized from the general fund; it's not a huge external cost, but it's a cost. Driving also creates (perceived) danger to people biking and walking; that tends to encourage them to also drive for their own (perceived) safety, even when they otherwise would not, and the congestion costs of driving also delay bus transit, making it less useful (it's already slower because of all the stops; traffic jams make it slower yet).
I commute-by-bike on a road with bike lanes in Somerville and Cambridge. At rush hour, no matter what the speed limit, the fastest way from point A to point B is a bicycle (unless A and B are stops on the red line), almost never exceeding 20mph. The reason cars are slow is that they take up too much space and have to wait in line, again and again and again.