On 17.04.2011 22:52, Alf P. Steinbach /Usenet wrote:
> * MikeP, on 17.04.2011 18:57:
>> A wrote:
>>> Microsoft thinks C++ is obsolete and C# is "the future". Apple thinks
>>> the same for Objective-C.
>>>
>>> IMO this is all nonsense.
>>>
>>> What do you think about this? How "better" really they are? And what
>>> about C++0x?
>>
>> Use C# when you can, use C++ when you still have to.
>
> Certainly good advice from a programmer effectiveness perspective.
>
> But I think I'd hate for more of the "not-small" garbage collected
> programs infesting the PC environment. This is not provable, it is
> perhaps not even measurable in any consistent way!, but right now on my
> old machine, the newer versions of Thunderbird, Firefox and Opera, not
> to mention Windows Update (which is almost exotic in how many ways it
> just acts as malware, and its sheer extreme inefficiency), bog things
> down to a crawl, a snail's pace. I think what's going on is a subtlety
> that I call *the stretch effect* (he he, I guess some folks will say
> that it is also a stretch as a hypothesis):
>
> * One garbage collector based process is fine OK. As it allocates more
> virtual memory than the system is comfortable with, things slow down
> and the garbage collector kicks in, fixing it. Anyway, you don't get
> into that situation unless it's necessary for the program.
>
> * Two or more garbage collector based processes are Bad. As they
> happily allocate more and more virtual memory the OS just obliges,
> providing virtual memory at higher and higher cost (the stretching),
> and goes into *trashing* behavior. In general the processes never get
> to the point where their garbage collectors could have fixed things.
>
> One problem is that each process does not see the *cost* of its
> allocation(s).
> ...
Well, I guess it doesn't really require GC to see this effect.
Programs written in VM/scripted languages do factually take up more
resources that programs written in native/compiled languages.
(Not that *I* measured it, and there's certainly examples to the
opposite, and theoretical scenarios where there's no difference, but I
guess we can agree that for the vast majority of programs my statement
holds, yes?)
Now, as you say, this doesn't matter at all, if you have one (few) such
programs, but when "all" programs on a machine are VM/script/GC based
programs, I expect this to have a huge impact on resource consumption
and performance and perceived performance.
I have 4 (four) "applications" open as I write this on my Windows XP
machine. There are 78 processes running, of which only three (according
to Process Explorer) are .NET/managed apps.
I certainly -- don't

-- want to know what kind of crawl I'd see on
this machine if a significant number of these processes were VM/GC
processes.
For a single application it makes sense to use a managed/scripted
approach, but "the industry" as a whole could ask itself whether we are
using the resources ("we" and) the users have to good effect if too much
stuff moves to VM/GC.
002,
Martin
--
Stop Software Patents
http://petition.stopsoftwarepatents.eu/841006602158/
http://www.ffii.org/