bugake
Joined 1 month ago
Joined 1 month ago
F. A. Hayek, The Fatal Conceit (1988).
The government funds AI companies by pretending to buy services from them. And that doesn't counts as "government revenue", but just sales. That's why Anthropic sued the Pentagon when it decided not to buy from Anthropic. Those services are fake.
You are detached from reality because your belief is Marxist, and Marxists define Marxism as "dialectical materialism." The dialectic is the Gnostic (religious) superstition that "opposite things are the same," which is intentionally incompatible with the principle of non-contradiction in logic. So Marxism is intentionally illogical and irrational, and that's why you are brainwashed and detached from reality.
In socialism, it's always the manager of public funds who decides what you want and what you need, and they neither know nor care.
Capitalism works for profit, which means that companies have to produce what people want, and what they produce has to be more valuable than the cost of production. Instead, AI companies have massive losses, covered by fake income from the state, and the state doesn't care if you cannot buy RAM.
Everything bought with state money is no longer available to consumers, and it's always the poorest who can no longer buy what has become scarce. So public spending is always paid for by the poorest, even if "the rich are taxed."
So you cannot expect the compiler to automatically perform every possible optimization. The programmer still needs to understand how the code behaves and write it with performance in mind.
You may be perfectly sure that no other thread modifies the data, but the compiler doesn't know, so it avoids all kind of optimizations.
If you expect the compiler to perform those optimizations automatically, you still have to do things like declare certain variable variables and or function parameters as constant (since the compiler may otherwise have to assume that their values could be modified by side effects/threads, preventing certain optimizations), use specific attributes or annotations on functions, and provide specific compilation flags. That's more complex than simply coding the for loop backwards.
And the worst thing is that frequently the compiler assumes a constant could be modified anyway, and avoids optimizing just in case.
"Comparing an integer to zero is sometimes more efficient than comparing it to any other number. Therefore, it is slightly more efficient to make a loop count down to zero than to make it count up to some positive value, n. But not if the loop counter is used as an array index. The data cache is optimized for accessing arrays forwards, not backwards."
Yet that text was written for older CPUs. Modern CPUs are better at prefetching backwards access patterns, but if you try a microbenchmark with backwards array traversal, you may get misleading results.
It's like checking for overflow in an arithmetic operation. Other languages do the checking, and that's why they're slower. But C++ doesn't check because it offloads the responsibility to the coder, so the coder can write faster code if he makes sure there are no bugs.
If the coder knows there will be four return values and writes them one after the other, the return (or MOV) instructions are distanced the same. The goto hack should work.