Current version

v1.10.4 (stable)

Navigation

Main page
Archived news
Downloads
Documentation
   Capture
   Compiling
   Processing
   Crashes
Features
Filters
Plugin SDK
Knowledge base
Donate
Contact info
Forum
 
Other projects
   Altirra

Search

Archives

01 Dec - 31 Dec 2013
01 Oct - 31 Oct 2013
01 Aug - 31 Aug 2013
01 May - 31 May 2013
01 Mar - 31 Mar 2013
01 Feb - 29 Feb 2013
01 Dec - 31 Dec 2012
01 Nov - 30 Nov 2012
01 Oct - 31 Oct 2012
01 Sep - 30 Sep 2012
01 Aug - 31 Aug 2012
01 June - 30 June 2012
01 May - 31 May 2012
01 Apr - 30 Apr 2012
01 Dec - 31 Dec 2011
01 Nov - 30 Nov 2011
01 Oct - 31 Oct 2011
01 Sep - 30 Sep 2011
01 Aug - 31 Aug 2011
01 Jul - 31 Jul 2011
01 June - 30 June 2011
01 May - 31 May 2011
01 Apr - 30 Apr 2011
01 Mar - 31 Mar 2011
01 Feb - 29 Feb 2011
01 Jan - 31 Jan 2011
01 Dec - 31 Dec 2010
01 Nov - 30 Nov 2010
01 Oct - 31 Oct 2010
01 Sep - 30 Sep 2010
01 Aug - 31 Aug 2010
01 Jul - 31 Jul 2010
01 June - 30 June 2010
01 May - 31 May 2010
01 Apr - 30 Apr 2010
01 Mar - 31 Mar 2010
01 Feb - 29 Feb 2010
01 Jan - 31 Jan 2010
01 Dec - 31 Dec 2009
01 Nov - 30 Nov 2009
01 Oct - 31 Oct 2009
01 Sep - 30 Sep 2009
01 Aug - 31 Aug 2009
01 Jul - 31 Jul 2009
01 June - 30 June 2009
01 May - 31 May 2009
01 Apr - 30 Apr 2009
01 Mar - 31 Mar 2009
01 Feb - 29 Feb 2009
01 Jan - 31 Jan 2009
01 Dec - 31 Dec 2008
01 Nov - 30 Nov 2008
01 Oct - 31 Oct 2008
01 Sep - 30 Sep 2008
01 Aug - 31 Aug 2008
01 Jul - 31 Jul 2008
01 June - 30 June 2008
01 May - 31 May 2008
01 Apr - 30 Apr 2008
01 Mar - 31 Mar 2008
01 Feb - 29 Feb 2008
01 Jan - 31 Jan 2008
01 Dec - 31 Dec 2007
01 Nov - 30 Nov 2007
01 Oct - 31 Oct 2007
01 Sep - 30 Sep 2007
01 Aug - 31 Aug 2007
01 Jul - 31 Jul 2007
01 June - 30 June 2007
01 May - 31 May 2007
01 Apr - 30 Apr 2007
01 Mar - 31 Mar 2007
01 Feb - 29 Feb 2007
01 Jan - 31 Jan 2007
01 Dec - 31 Dec 2006
01 Nov - 30 Nov 2006
01 Oct - 31 Oct 2006
01 Sep - 30 Sep 2006
01 Aug - 31 Aug 2006
01 Jul - 31 Jul 2006
01 June - 30 June 2006
01 May - 31 May 2006
01 Apr - 30 Apr 2006
01 Mar - 31 Mar 2006
01 Feb - 29 Feb 2006
01 Jan - 31 Jan 2006
01 Dec - 31 Dec 2005
01 Nov - 30 Nov 2005
01 Oct - 31 Oct 2005
01 Sep - 30 Sep 2005
01 Aug - 31 Aug 2005
01 Jul - 31 Jul 2005
01 June - 30 June 2005
01 May - 31 May 2005
01 Apr - 30 Apr 2005
01 Mar - 31 Mar 2005
01 Feb - 29 Feb 2005
01 Jan - 31 Jan 2005
01 Dec - 31 Dec 2004
01 Nov - 30 Nov 2004
01 Oct - 31 Oct 2004
01 Sep - 30 Sep 2004
01 Aug - 31 Aug 2004

Stuff

Powered by Pivot  
XML: RSS feed 
XML: Atom feed 

§ "Hello, world!" is a lot bigger than I remember it

I wanted to hack together a particular variant of expression evaluator, but wanted an editor a bit more substantial than the usual Notepad I use for quick hacks. So I fired up Visual Studio 2005, and on a whim, decided to select "CLR Console Application." And so VS2005 set up a sample console Hello World! application for me. C++/CLI is still C++, so the source code file mostly looks the same, just that it uses .NET console commands.

Oh, and the project comes with an icon, a resource script, stdafx.cpp/.h, an assembly info module, and a readme. I guess I can deal with that for a throwaway project.

Then I run it, and I see these DLL load messages in the debugger:

'arith.exe': Loaded 'D:\projwin\arith\debug\arith.exe', Symbols loaded.
'arith.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\system32\mscoree.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\system32\advapi32.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\system32\rpcrt4.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcr80d.dll', Symbols loaded.
'arith.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcm80d.dll', Symbols loaded.
'arith.exe': Loaded 'C:\WINDOWS\system32\ole32.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\system32\gdi32.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\system32\user32.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\system32\imm32.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\system32\lpk.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\system32\usp10.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\system32\shlwapi.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_0de06acd\msvcr80.dll', Symbols loaded.
'arith.exe': Loaded 'C:\WINDOWS\system32\shell32.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.Windows.Common-Controls_6595b64144ccf1df_6.0.2600.2180_x-ww_a84f1ff9\comctl32.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\system32\comctl32.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Culture.dll', No symbols loaded.
'arith.exe': Unloaded 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Culture.dll'
'arith.exe': Loaded 'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\mscorlib\813d7cb23dfcd94ebf2b2429ea4bcb50\mscorlib.ni.dll', No native symbols in symbol file.
'arith.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll', Symbols loaded.
'arith.exe' (Managed): Loaded 'd:\projwin\arith\debug\arith.exe', Symbols loaded.
'arith.exe': Loaded 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\mscorjit.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\diasymreader.dll', Symbols loaded (source information stripped).
'arith.exe': Loaded 'C:\WINDOWS\system32\rsaenh.dll', Symbols loaded (source information stripped).
'arith.exe' (Managed): Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcm80d.dll', Symbols loaded.
'arith.exe': Loaded 'C:\WINDOWS\assembly\NativeImages_v2.0.50727_32\System\92defad1f6443a41812dd46665fe005c\System.ni.dll', No native symbols in symbol file.
'arith.exe' (Managed): Loaded 'C:\WINDOWS\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll', Symbols loaded.

WTF?

I try to convince myself that I'm a assembly/C++ luddite and I should try to learn more of this .NET stuff. Every time I do, I see stuff like this that makes me cringe. Why does a Hello World application require the common controls library, shell API, and remote procedure call runtime??

Here's what I get from a good old fashioned Win32 Hello World app made by VS2005, for comparison:

'arith2.exe': Loaded 'D:\projwin\arith2\Debug\arith2.exe', Symbols loaded.
'arith2.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', Symbols loaded (source information stripped).
'arith2.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', Symbols loaded (source information stripped).
'arith2.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc8b3b9a1e18e3b_8.0.50727.42_x-ww_f75eb16c\msvcr80d.dll', Symbols loaded.
'arith2.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', Symbols loaded (source information stripped).

Comments

Comments posted:


*WTF? is exactly right!* Java has always been like this, 100's (1000's ??) of classes that are incestuous to the point of insanity and .NET is every bit as bad, if not worse. And where is the benefit from this. I see none. It just multiplies the bugs out, even if you get down to 1 bug per 100,000 line of code, there are a lot more than 100,000 lines of code here.

IanB - 20 05 06 - 02:36


Well, in that case you may want to merely replace Notepad with a text editor that can do syntax highlighting. I know there's a bunch of them built in Linux desktop environments (Kwrite and Kate come to mind for KDE users, Vim too for hardcore CLI afficionados), but for Windows I merely find a lack of choice...

Mitch 74 - 20 05 06 - 05:32


Notepad-plus is a open source project , syntax hilight,

etc etc etc , check it out, source available

T-ROY (link) - 20 05 06 - 17:53


What was first (0 < x < oo)?
a) x MB ram
b) apps that need at x MB ram
c) apps that use x MB ram and don't need it

Murmel - 21 05 06 - 14:34


SciTE works very nicely as an advanced text editor: lots of pre-defined settings for syntex hilighting of just about any language you care to name, and even has a tabbed interface.

Aefaradien - 21 05 06 - 19:26


This is because you're using the .NET CLR, which implicitly links all this crap. Which means that even if the program the CLR is running doesn't need them, they still get loaded. I think it would be better to load all that crap on demand, but that's probably "too much work" for the CLR people, and they're probably also worried about it taking too long to bring up a common dialog or something.

In the end, just say NO to CLR. At least for simple apps, anyway.

Coderjoe - 22 05 06 - 13:51


I program mostly Java for a living and you know I wish I could spend some time in assembly/C++. I did get a PIC recently that I look forward to learning how to program for.

Ron - 23 05 06 - 01:58


I use TextPad. It also has the capability to record+playback keyboard macros which comes in handy.

AlanC - 24 05 06 - 08:32


You may want to check out Crimson Editor, or PSPad. Both are freeware, and oriented toward coding. I used to use CE for C++ with Borland's free tools. I've switched to PSPad since.

messiah - 24 05 06 - 22:02


as a text editor with syntax highlight, and blah blah blah, I use Nedit, on Linux, Solaris and Windows.
I'm sure is more powerfull than Vim and Emacs.
http://www.nedit.org/

efa - 21 08 06 - 15:38


The number of DLLs loaded is not particularly relevant. .NET makes reference to these for various reasons, but that does not mean they contribute materially to your working set - the only things in memory are those which are actively used. Also, remember that very common DLLs are going to get loaded anyhow (common components is one of these.) These DLLs are only loaded once for all processes, even though they show as being 'loaded' by the debugger, they are probably only being referenced, having previously been loaded by another application.

Nothign to see here, move along.

Cliff - 26 12 06 - 21:22


Not quite.

For starters, even if they eventually get dropped out of the process working set, they will impact load time, as the OS has to initialize them locally for the process. A DLL that is linked to always executes its DllMain, regardless of whether any of its APIs are used. Additionally, if there is an address space collision for any reason, the OS will be forced to copy all pages in the DLL in order to relocate it to a new location.

Second, having GUI DLLs loaded into a console process is an issue as this forces the OS to allocate GUI resources for a process that wouldn't ordinarily need them. If you don't use GUI APIs, the kernel will not bother to enlarge the kernel stacks, allocate message queues, etc.

Finally, it makes debugger startup time MUCH worse as symbols are loaded for all of those DLLs.

These issues obviously shrink in importance as the rest of the console application grows in complexity. However, for small and simple console applications, you cannot deny that the .NET Framework startup cost is a much greater proportion than for a native C++ application. If you are trying to write lightweight console applications designed to be chained together in a script, or are running in a heavy Terminal Server scenario, these costs could become significant.

Phaeron - 27 12 06 - 04:53

Comment form


Please keep comments on-topic for this entry. If you have unrelated comments about VirtualDub, the forum is a better place to post them.
Name:  
Remember personal info?

Email (Optional):
Your email address is only revealed to the blog owner and is not shown to the public.
URL (Optional):
Comment: /

An authentication dialog may appear when you click Post Comment. Simply type in "post" as the user and "now" as the password. I have had to do this to stop automated comment spam.



Small print: All html tags except <b> and <i> will be removed from your comment. You can make links by just typing the url or mail-address.