[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [TSVN] CString vs std::string

From: Will Dean <svn_at_indcomp.co.uk>
Date: 2004-12-22 12:21:18 CET

At 11:54 22/12/2004 +0100, you wrote:

>Yes. I wanted to keep the shell extension part free of MFC/ATL. That
>part alone should be very lightweigth, i.e. not needing any other
>dll's to load.

OK, I had a little test of this. I made two files, atltest and stdtest,
which looked like this:

#include <string>
#include <stdio.h>
int main()
{
         std::string str("Hello, world\n");
         printf("%s", str.c_str());
         return 0;
}

and this:

#include <atlstr.h>
#include <stdio.h>
int main()
{
         CString str("Hello, world\n");
         printf("%s", (LPCTSTR)str);
         return 0;
}

I compiled them both like this:

cl /Os /MD /EHsc filename.cpp

Which is a release-build, space-optimised compile, dynamically linked
against the CRT. STL needs the exception handling, which ATL didn't, but I
put it in on both to be fair...

The two exes are like this:

   9,216 ATLTest.exe
   4,096 stdtest.exe

and as far as DLL dependancies go,

ATLTest depends on KERNEL32.DLL and MSVCR71.DLL
stdtest depends on KERNEL32.DLL, MSVCR71.DLL and MSVCP71.DLL (this last is
the STL)

I would say that the .exe size difference is irrelevant, as it's probably a
fixed amount which gets added on, not a factor of 2.

I think the STL dependancy is also irrelevant, as we're probably going to
have that in both cases in real life.

I conclude that there isn't much to chose between them in terms of
dependency. AFAIK, ATL was specifically designed for lightweight plug-in
components (like web-delivered ActiveX controls), so ought to be fairly
suitable for us here.

What do you reckon?

Cheers,

Will

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Wed Dec 22 13:22:05 2004

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.