Thomas Kellar on Sun, 01 May 2022 16:18:09 +0200
|
[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]
- To: pari-users@pari.math.u-bordeaux.fr
- Subject: question about speed
- From: Thomas Kellar <wangude@gmail.com>
- Date: Sun, 1 May 2022 10:17:53 -0400
- Delivery-date: Sun, 01 May 2022 16:18:09 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=Kra889SbAOxV65Gv7KNGP/LlLOHhT46rt1HH/nduiag=; b=mRl1oJtOzFNPUyQz+Qu4Djpt/fdJNmZ1GEtrLYA7PN5WyVZU3Pj9wZkEodwGoeBu/b 24Kn6AAkB8FQuTun9rXQOYe7OGX5aOfraI5XvLLW9g0YxHhev9wmcwd1n0WFFMHA7UGC MIJdJLmonoXfpOYFL6VytevtTdna9rr6QcZrTOQ0rDupflwlapg1bcNUCBElHGLRYU5C OERjO8v1yCEwoC6JywiDR8wPLRfBgWEPgIlpeAWG70IfnRl6ewuaLsW5tYoWGwi51ofo XeTr5OotrYiiXbK4XS4/V4zSLt2QRmIT4+7nVlJXoQbNsQcpLcof4WWb6hhx9lLwX9Ge iVuQ==
I have code that looks like the below running billions
of times and the top one is a little faster than the bottom
one. This is not intuitive to me. Is there any explanation?
if (a == b,
return(0);
);
return(1);
why is the above faster:
and the below slower:
if (a == b,
return(0);
,
return(1);
);
Is that always the case?
Thanks
Thomas