April 02, 2006
Bruno Medeiros schrieb am 2006-04-02:
> The best that I could find was by looking at the assembly code, and that in the class version a _d_newclass function is called instead of _d_new for the struct version, yet does _d_newclass do more than _d_new other than just initialize the pointers?

have a look at: src/phobos/internal/gc/gc.d

Thomas


April 02, 2006
Thomas Kuehne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Bruno Medeiros schrieb am 2006-04-02:
>> The best that I could find was by looking at the assembly code, and that in the class version a _d_newclass function is called instead of _d_new for the struct version, yet does _d_newclass do more than _d_new other than just initialize the pointers?
> 
> have a look at: src/phobos/internal/gc/gc.d
> 
> Thomas
> 
> 

AGH... seems the Windows search doesn't search inside *.d files, thus, I didn't find that before. Way to go Windows :(  Seems I'll have to use the command line.

-- 
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
April 02, 2006
Thomas Kuehne wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Bruno Medeiros schrieb am 2006-04-02:
>> The best that I could find was by looking at the assembly code, and that in the class version a _d_newclass function is called instead of _d_new for the struct version, yet does _d_newclass do more than _d_new other than just initialize the pointers?
> 
> have a look at: src/phobos/internal/gc/gc.d
> 
> Thomas
> 
> 
> -----BEGIN PGP SIGNATURE-----
> 
> iD8DBQFEL8wo3w+/yD4P9tIRAgSsAJ9pC8xp4D8N5+ykxPueNKw0nmm1OwCgvcs1
> U2k6rgOjvcYbtgYUJwjUKWY=
> =97Mb
> -----END PGP SIGNATURE-----
Hum, after some testing it seems the class overhead is caused primarily by the call:
  _gc.setFinalizer(p, &new_finalizer);


The class test with this line runs in 40 seconds.
With just:
  _gc.setFinalizer(p, null);
it runs in 31 seconds.
And finally without the line at all it runs in 19 seconds, which is now quite close to the struct version.

Since this class has no destructors (in it self, or in a base class), I think setting up a finalization is redundant, unless there is some need related to the monitor releasing (dont know about it). In any case there is some room for compiler optimization.

-- 
Bruno Medeiros - CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D
April 02, 2006
Bruno Medeiros wrote:
> Thomas Kuehne wrote:
> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Bruno Medeiros schrieb am 2006-04-02:
>>
>>> The best that I could find was by looking at the assembly code, and that in the class version a _d_newclass function is called instead of _d_new for the struct version, yet does _d_newclass do more than _d_new other than just initialize the pointers?
>>
>>
>> have a look at: src/phobos/internal/gc/gc.d
>>
>> Thomas
>>
>>
> 
> AGH... seems the Windows search doesn't search inside *.d files, thus, I didn't find that before. Way to go Windows :(  Seems I'll have to use the command line.
> 

I use Visual Studio's "find in files" feature.
April 02, 2006
Bruno Medeiros wrote:
> Thomas Kuehne wrote:
> 
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA1
>>
>> Bruno Medeiros schrieb am 2006-04-02:
>>
>>> The best that I could find was by looking at the assembly code, and that in the class version a _d_newclass function is called instead of _d_new for the struct version, yet does _d_newclass do more than _d_new other than just initialize the pointers?
>>
>>
>> have a look at: src/phobos/internal/gc/gc.d
>>
>> Thomas
>>
>>
> 
> AGH... seems the Windows search doesn't search inside *.d files, thus, I didn't find that before. Way to go Windows :(  Seems I'll have to use the command line.
> 

Windows Search only works on file extensions that it has search filters defined for.  This is why you can search within Word / Excel (and many other binary format) documents as if they were text.  I'm sure there's some way (aside from writing a custom search filter) to get Windows Search to treat '.d' files as text.

I'd say the search idea was good, but should've defaulted to searching unknown files as UTF-8 encoded text just for a sensible default that could be worked around.

-- 
Regards,
James Dunne
1 2 3 4 5
Next ›   Last »