----- Original Message -----
From: "Ranjit Mathew" <rmathew@...>
To: "MinGW Developers" <mingw-dvlpr@...>
Sent: Monday, January 06, 2003 5:46 PM
Subject: [MinGW-dvlpr] Re: _CRTIMP again.
> Danny Smith wrote:
> > I just noticed speed of mingw.cygwin being discussed on gcc-help :
> > http://gcc.gnu.org/ml/gcc-help/2003-01/msg00032.html
> > Modifying the test case shown there like so, give as intersting DECLSPEC
> > comparison for mingw, with a 50% reduction in time on my ancient
> > pentium.
> Can someone please explain how explicit "dllimport" marking
> like this speeds things up?
If you _don't_ declare the sin() function as dllimport, the call is
assembled as just "call _sin", and the import library contains the
The "__imp__sin" variable is a pointer in the import table which will be
filled in by the OS loader. If you explicitly declare it as dllimport then
the compiler can generate "call [__imp__sin]" so the extra jump is avoided.
This also shows why you _need_ the dllimport for data symbols (except for
the latest magical release candidate of binutils), because you can't have a
simple stub function. I didn't know there could be such a speed increase,
> Thanks in advance.
> Ranjit Mathew Email: rmathew AT hotmail DOT com
> Bangalore, INDIA. Web: http://ranjitmathew.tripod.com/