flat assembler
Message board for the users of flat assembler.

Index > Windows > speed difference between calling conventions

Author
Thread Post new topic Reply to topic
dev_89



Joined: 24 Feb 2013
Posts: 8
dev_89 23 Apr 2013, 08:10
i'm interested to know that is there any speed difference between c calling convention and stdcall?
and when we REALLY need to use c calling convention?
Post 23 Apr 2013, 08:10
View user's profile Send private message Reply with quote
bitRAKE



Joined: 21 Jul 2003
Posts: 4047
Location: vpcmpistri
bitRAKE 23 Apr 2013, 09:02
The obvious case is where the callee doesn't know the number of parameters pushed on the stack (ex. wsprintf, et al.). Speed is quite relative - both techniques can be optimized in different way. The most important aspect in terms of modern code is that the stack memory is already in the cache.

I've alway liked the ENTER instruction - quite powerful if used fully. Reserves and copies data across stack frames. Requires a lot of planning to make it work effectively though.
Post 23 Apr 2013, 09:02
View user's profile Send private message Visit poster's website Reply with quote
f0dder



Joined: 19 Feb 2004
Posts: 3175
Location: Denmark
f0dder 23 Apr 2013, 16:41
For anything worth calling, calling convention overhead should be pretty irrelevant - inline stuff where it matters.

(Of course every bit of extra speed doesn't hurt - but if you're looking to "reduce the overhead of calling PutPixel", you're Doing Things Wrong(TM)).
Post 23 Apr 2013, 16:41
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.