View mode: basic / threaded / horizontal-split · Log in · Help
October 06, 2005
Performance, operating system in D?
I read that modern garbage collected languages are faster than non-gbc ones.
Given that all other thins (compiler optimization quality) are equal, I suppose
that's true for an application program. If one wants to make an operating system
on the other hand, which be its definition must manage memory itself(?) is it
possible to achieve the same control and performance as if it was made in C/C++?

And for application programs - is there a D gc DLL that D programs can share?
Somewhat out-of-topic but Will Windows Vista have gc built-in?

are there some good tests of D performance vs C?
October 06, 2005
Re: Performance, operating system in D?
Will wrote:
> I read that modern garbage collected languages are faster than non-gbc ones.
> Given that all other thins (compiler optimization quality) are equal, I suppose
> that's true for an application program. If one wants to make an operating system
> on the other hand, which be its definition must manage memory itself(?) is it
> possible to achieve the same control and performance as if it was made in C/C++?
> 
> And for application programs - is there a D gc DLL that D programs can share?
> Somewhat out-of-topic but Will Windows Vista have gc built-in?
> 
> are there some good tests of D performance vs C?
> 
> 

Maybe this will help.

http://shootout.alioth.debian.org/benchmark.php?test=all&lang=dlang&sort=fullcpu
October 07, 2005
Re: Performance, operating system in D?
Will wrote:
> I read that modern garbage collected languages are faster than non-gbc ones.
> Given that all other thins (compiler optimization quality) are equal, I suppose
> that's true for an application program. If one wants to make an operating system
> on the other hand, which be its definition must manage memory itself(?) is it
> possible to achieve the same control and performance as if it was made in C/C++?
> 
> And for application programs - is there a D gc DLL that D programs can share?
> Somewhat out-of-topic but Will Windows Vista have gc built-in?
> 
> are there some good tests of D performance vs C?
> 
> 

Let's see... It's my take that garbage collected languages' performance 
derives directly from two things:
	1) quality of implementation of the GC
	2) frequency of memory allocations/deallocations in the compiled program

For a language like D, where the new operator is a common occurence, the 
performance of the application is directly related to the performance of 
the GC.  D's current GC implementation leaves a bit to be desired and is 
not an implementation of a top-notch GC.  It is very simple and gets the 
job done reasonably well for most applications.

Moving on... No DLL housing currently exists for D's GC (that I'm aware 
of), and I don't think you'd want to put one in a DLL either.  If you're 
attempting to write an OS from scratch using D, then it is a good idea 
to learn the ins and outs of phobos.

If I were in your position, I would scratch the phobos GC and most of 
phobos itself in your operating system.  I would keep only the very 
basic parts of the code which are necessary in order for D to work - 
things like bit slicing functions, the Object class, TypeInfos, etc.

Then, I would write a top-notch, tested, garbage collection 
implementation using proven concepts from the latest research on the 
topic.  However, you must consider the memory model of whatever type of 
OS you're trying to write.  If you're writing a multi-tasking, 
multi-user OS, design your GC such that sufficient access protections 
are in place.

I hope this can get you headed in the right direction, and I hope to see 
 Will/OS in the future!

-- 
Regards,
James Dunne
October 10, 2005
Re: Performance, operating system in D?
In article <di4149$69$1@digitaldaemon.com>, Will says...
>
>I read that modern garbage collected languages are faster than non-gbc ones.
>Given that all other thins (compiler optimization quality) are equal, I suppose
>that's true for an application program. If one wants to make an operating system
>on the other hand, which be its definition must manage memory itself(?) is it
>possible to achieve the same control and performance as if it was made in C/C++?
>

The current D GC implementation is decent but hasn't had the large amount of
tweaking that others have had (i.e.: Sun Java and .NET). It is now a
conservative collector, and swapping to a generational/copying algorithm would
probably increase performance quite a bit for things like allocating lots of
small objects, which is probably the biggest weakness right now. OTOH, a change
like that would probably make the GC less space efficient overall which is a
current strength I think.


>And for application programs - is there a D gc DLL that D programs can share?
>Somewhat out-of-topic but Will Windows Vista have gc built-in?
>

The beauty of D is that you can use traditional malloc/free memory management,
and you can also still use the GC to manage a block of memory used to relatively
easily "pool" a group of often allocated objects. Along with that, D has two
other advantages over most other GC'd languages: easy array slicing and built-in
stack allocated UDT's (D structs).

AFAICT, Vista will not have the GC built-in unless your app. runs under the .NET
runtime.

>are there some good tests of D performance vs C?
>

Here are some results you can take with a grain of salt <g>

http://shootout.alioth.debian.org/benchmark.php?test=all&lang=all&sort=fullcpu
October 10, 2005
Re: Performance, operating system in D?
Will wrote:
> I read that modern garbage collected languages are faster than non-gbc ones.

You need to be a little careful with such generalisations.
In practice, Doug Lea Malloc is hard to beat in most situations, but it 
is very easy to do better than Microsoft's default malloc.
The only hard data I've seen shows that the best GC outperforms dlmalloc 
once it has access to 5-10 times as much memory as is allocated at any 
given time.

Sc...
* in the cases where GC is faster, it will use 10x as much memory
* There is huge variation in quality of implementation.
* Doug Lea malloc is probably nearly as good as malloc can be, GC is 
much more complicated and is less well optimised, so it is likely to 
improve with time.
* Right now, the languages (apart from D) which produce the fastest 
programs are not gc-based. But that's not because they don't use gc, 
it's because they were designed for speed.
* The benefits of gc are in code simplicity, not speed.


> Given that all other thins (compiler optimization quality) are equal, I suppose
> that's true for an application program. If one wants to make an operating system
> on the other hand, which be its definition must manage memory itself(?) is it
> possible to achieve the same control and performance as if it was made in C/C++?
> 
> And for application programs - is there a D gc DLL that D programs can share?
> Somewhat out-of-topic but Will Windows Vista have gc built-in?
> 
> are there some good tests of D performance vs C?
> 
>
October 10, 2005
Re: Performance, operating system in D?
"Will" <Will_member@pathlink.com> wrote in message
news:di4149$69$1@digitaldaemon.com...
> And for application programs - is there a D gc DLL that D programs can
share?
> Somewhat out-of-topic but Will Windows Vista have gc built-in?

I've always thought that gc ought to be a service provided by the operating
system. There are so many garbage collected languages in common use - having
it in the o.s. makes it worthwhile to make a very good one, and so all the
languages benefit.
October 10, 2005
Re: Performance, operating system in D?
In article <diekpi$qev$1@digitaldaemon.com>, Walter Bright says...
>
>"Will" <Will_member@pathlink.com> wrote in message
>news:di4149$69$1@digitaldaemon.com...
>> And for application programs - is there a D gc DLL that D programs can
>share?
>> Somewhat out-of-topic but Will Windows Vista have gc built-in?
>
>I've always thought that gc ought to be a service provided by the operating
>system. There are so many garbage collected languages in common use - having
>it in the o.s. makes it worthwhile to make a very good one, and so all the
>languages benefit.

That would be darn nice.  And since the OS handles context switching and such,
it seems a natural fit.  Does the Java OS have built-in GC?  Or maybe one of the
other fancy thin-client OSes?


Sean
October 11, 2005
Re: Performance, operating system in D?
"Walter Bright" <newshound@digitalmars.com> wrote in message 
news:diekpi$qev$1@digitaldaemon.com...
> I've always thought that gc ought to be a service provided by the 
> operating
> system. There are so many garbage collected languages in common use - 
> having
> it in the o.s. makes it worthwhile to make a very good one, and so all the
> languages benefit.

I wonder if Vista will have a built-in GC facility, as .Net will become more 
intimately integrated into the OS?

Maybe D.Net would be a worthwhile investment.. ;)
October 11, 2005
Re: Performance, operating system in D?
In article <diekpi$qev$1@digitaldaemon.com>, Walter Bright says...
>
>
>"Will" <Will_member@pathlink.com> wrote in message
>news:di4149$69$1@digitaldaemon.com...
>> And for application programs - is there a D gc DLL that D programs can
>share?
>> Somewhat out-of-topic but Will Windows Vista have gc built-in?
>
>I've always thought that gc ought to be a service provided by the operating
>system. There are so many garbage collected languages in common use - having
>it in the o.s. makes it worthwhile to make a very good one, and so all the
>languages benefit.
>
>

I still am looking for some other ambitious programmers to work on a D kernel
that can run multiple types of compiled executables (ELF, PE, COFF, etc)...

Than, you could just GC at the OS level, and .. yeah.. Do something amazing you
know.. Any takers?

Thanks,
Trevor Parscal
October 11, 2005
Re: Performance, operating system in D?
In article <difq92$t5v$1@digitaldaemon.com>, Trevor Parscal says...
>
>In article <diekpi$qev$1@digitaldaemon.com>, Walter Bright says...
>>
>>
>>"Will" <Will_member@pathlink.com> wrote in message
>>news:di4149$69$1@digitaldaemon.com...
>>> And for application programs - is there a D gc DLL that D programs can
>>share?
>>> Somewhat out-of-topic but Will Windows Vista have gc built-in?
>>
>>I've always thought that gc ought to be a service provided by the operating
>>system. There are so many garbage collected languages in common use - having
>>it in the o.s. makes it worthwhile to make a very good one, and so all the
>>languages benefit.
>>
>>
>
>I still am looking for some other ambitious programmers to work on a D kernel
>that can run multiple types of compiled executables (ELF, PE, COFF, etc)...
>
>Than, you could just GC at the OS level, and .. yeah.. Do something amazing you
>know.. Any takers?

Are you talking about a "day job" or spare time?

;)

Thomas
« First   ‹ Prev
1 2
Top | Discussion index | About this forum | D home