This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author blaisorblade
Recipients ajaksu2, blaisorblade, collinwinter, jyasskin, loewis, pitrou
Date 2009-01-16.23:41:42
SpamBayes Score 0.025917968
Marked as misclassified No
Message-id <1232149305.46.0.339435636102.issue4941@psf.upfronthosting.co.za>
In-reply-to
Content
Yep, agreed. It could be quite cool to rely on __attribute__((cold)) to
mark format_exc_check_arg(), but that only works with newer gcc's. I
guess I'll add many likely() by hand - in some cases GCC might already
get it right, but the heuristics used to choose the likely path
statically are quite arguable and subject to change. Also, on other
archs such hints might have a bigger impact on the generated code.

I'll give a look at that not earlier than February, or you're welcome to
try this. However, at least on x86, an "if (successCondition) {
success(); dispatch(); } failure();" will be probably compiled to
assembly like follows, equivalent to adding likely to the test:

evaluate successCondition
if_false goto err:
call to success();
dispatch next instrutions.

err:
call to failure();
History
Date User Action Args
2009-01-16 23:41:46blaisorbladesetrecipients: + blaisorblade, loewis, collinwinter, pitrou, ajaksu2, jyasskin
2009-01-16 23:41:45blaisorbladesetmessageid: <1232149305.46.0.339435636102.issue4941@psf.upfronthosting.co.za>
2009-01-16 23:41:44blaisorbladelinkissue4941 messages
2009-01-16 23:41:42blaisorbladecreate