Hacker News new | past | comments | ask | show | jobs | submit login

A useful technique in the design of an optimizing compiler is to include an "odometer test" on all endomorphic discretionary transformations. E.g., at a spot where one has a big go/no-go predicate that determines whether a change to the program is valid and beneficial, add a final term that's a call to a routine that returns true if odometer++ < limit. You can then use bisection on that limit and zero in quickly on the failing change.

This function is also a great place to put logging. I typically make it look like a printf() that returns a Boolean.




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: