Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
2102922286
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
5 ms
·
1.
▲
by
2102922286
3y ago
Here's a video made 53 years ago about how we need to tackle pollution: https://www.youtube.com/watch?v=MA45iKHjoGg A lot of it still rings true today. The sad thing is that we _knew_ that _something_ had to be done, b
2.
▲
by
2102922286
3y ago
https://uops.info/uiCA.html it's really cool!!
3.
▲
by
2102922286
3y ago
This is one area where Profile-Guided Optimization (PGO) can help a lot! With PGO, you run your program on some sample input and it logs info like how many times each side of a branch was taken. From there, you can recompile your code. If t
4.
▲
by
2102922286
3y ago
For the given assembly from the blog post loop: lea (%rdx,%rax,4),%rcx cmp (%rcx),%esi cmovg %rcx,%rdx shr %rax jne loop Here's a simulated CPU trace on Intel skylake: https://
5.
▲
by
2102922286
3y ago
If what you're saying is (roughly) cmovne rax, rdx jmp rax that is, a cmov followed by an indirect jump to the address contained in rax, "jmp rax" is _always_ an indirect jump. It doesn't matter
6.
▲
by
2102922286
3y ago
When implementing cryptographic primitives, you want to avoid branching on secret values. The reason why is that the CPU's branch predictor will attempt to predict the value that you're branching on, and thus something about the v
7.
▲
by
2102922286
3y ago
Cmov doesn't branch. A branch refers specifically to the program counter ending up in more than one possible place after an instruction has executed. It is this behavior that mucks with the CPU state and slows everything down. It'
8.
▲
by
2102922286
3y ago
A cool related algorithm is https://algorithmica.org/en/eytzinger In addition to being branchless, it also has better cache properties than a standard binary search tree. If you're doing a binary search in an arra
9.
▲
by
2102922286
3y ago
cmov (i.e. conditional move) doesn't branch. By branch here, we mean "at point at which the successor program counter value might be one of two locations." It's true that this _does_ have security implications, however t