Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
Lvl999Noob
16 days ago
|
parent
|
context
|
favorite
| on:
When compilers surprise you
Couldn't the compiler optimise this still? Make two versions of the function, one with constant folding and one without. Then at runtime, check the value of the parameter and call the corresponding version.
saagarjha
16 days ago
[–]
Yes, a sufficiently smart compiler can always tell you’re doing a benchmark and delete it. It’s just unlikely.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: