Conversation
Notices
-
Embed this notice
CMD (ceo_of_monoeye_dating@tsundere.love)'s status on Saturday, 14-Feb-2026 07:12:53 JST
CMD
@Ghislaine The simplest branch prediction is "it will" though :chino_dead1: - Johnny Peligro likes this.
-
Embed this notice
CMD (ceo_of_monoeye_dating@tsundere.love)'s status on Saturday, 14-Feb-2026 07:13:16 JST
CMD
@nigger @Ghislaine No.
When you execute instructions on a modern CPU it goes through this thing called a "pipeline." Essentially instead of executing one instruction at once, it executes part of 5-20 instructions at once. When one of those instructions is a conditional branch, this has the impact of potentially flushing out the entire pipeline because a lot of those partially executed instructions are invalid, which slows the computer down!
Branch prediction allows you to mitigate the impact of that - if you know how you're going to branch, you can pick the right set of instructions to feed through the pipeline most of the time, which is good enough for a substantial performance improvement. You don't need it to be perfect, you just need it to be cheap and better than nothing.Johnny Peligro likes this. -
Embed this notice
CMD (ceo_of_monoeye_dating@tsundere.love)'s status on Saturday, 14-Feb-2026 07:13:16 JST
CMD
@nigger @Ghislaine Essentially the difference between the two is "did I jump to the next line in my code or did I jump somewhere else?" They're meaningfully different from an engineering perspective. Even if you *could* in theory write the code so that it's logically equivalent, anyone who actually does this should have their heads blown off because the code is disgusting. Johnny Peligro likes this. -
Embed this notice
protoss (nigger@detroitriotcity.com)'s status on Saturday, 14-Feb-2026 07:13:18 JST
protoss
@ceo_of_monoeye_dating @Ghislaine aren't they just equivalent since the other branch is just boolean negation? -
Embed this notice
?? Humpleupagus ?? (humpleupagus@eveningzoo.club)'s status on Saturday, 14-Feb-2026 07:48:04 JST
?? Humpleupagus ??
When you install python on arch, the repo maintainers send you a free pair of stripped knee high socks. -
Embed this notice
Växẍ Säbbäth (vaxxsabbath@detroitriotcity.com)'s status on Saturday, 14-Feb-2026 07:48:05 JST
Växẍ Säbbäth
@nigger @ceo_of_monoeye_dating @Ghislaine Python is the gateway drug to transsexuality
change my mind
-
Embed this notice
CMD (ceo_of_monoeye_dating@tsundere.love)'s status on Saturday, 14-Feb-2026 07:48:06 JST
CMD
@nigger @Ghislaine Statistically, no!
If you consider the very simple code:
i = 0
while i < 5:
print(i)
i = i + 1
This branches every time until i hits 5.
So, it hits the branch:
i = 1: jump up
i = 2: jump up
i = 3: jump up
i = 4: jump up
i = 5: don't jump
Which is 80% of the time. It turns out that most code is written kinda like this; you're just usually in a loop of some kind that's incrementing, so you're usually just making the jump. -
Embed this notice
protoss (nigger@detroitriotcity.com)'s status on Saturday, 14-Feb-2026 07:48:06 JST
protoss
@ceo_of_monoeye_dating @Ghislaine >python
that's a place where no optimisation shines
:jahy_disgust: -
Embed this notice
CMD (ceo_of_monoeye_dating@tsundere.love)'s status on Saturday, 14-Feb-2026 07:48:07 JST
CMD
@nigger @Ghislaine Sure, the conditional within the branch can be reduced to being logically equivalent by using a different instruction (in modern architectures) but it still reduces to "are you jumping to the line specified in the code or not," and you do usually jump to the line. -
Embed this notice
protoss (nigger@detroitriotcity.com)'s status on Saturday, 14-Feb-2026 07:48:07 JST
protoss
@ceo_of_monoeye_dating @Ghislaine isn't it 50/50 for conditional jump and 100/0 for unconditional? or is some C
if (errorbyvalue(x))
exit(1);
bullshit going on here? -
Embed this notice
protoss (nigger@detroitriotcity.com)'s status on Saturday, 14-Feb-2026 07:48:08 JST
protoss
@ceo_of_monoeye_dating @Ghislaine I know that much, but whether the condition is true or false in the no branch jump case differs based on how you lower to assembly except for an if with no else