I am porting some of my C++ code that was highly specialized to a certain subset of problems where I manually optimized some of my algorithm convergence controls. For readability and possibly my compiler I converted the profile data to the likely() macros. It would be wonderful if I could include this profile information somewhere other then the comments.
Out of curiosity, does Java have anything similar to the GNU __builtin_expect / likely() hints?
Java profiles itself based on how it is run. You don’t need to use likely() as it will measure this itself on a per run basis.
For expectation you can use assertions.
or