I wrote an AR archive (.a files) parser in D

Renato Athaydes renato at athaydes.com
Thu Aug 22 16:21:45 UTC 2024


On Thursday, 22 August 2024 at 14:17:52 UTC, IchorDev wrote:
> On Tuesday, 20 August 2024 at 19:53:40 UTC, Renato wrote:
>> Now, I am curious why D is so much faster than Dart
>
> That’s why I’d really like to know what D compiler & flags 
> you’re measuring the speed with. Like, is it really faster 
> across the board, or only when using optimised LDC2 builds?
> I can imagine the difference could also be to do with Dart’s 
> libraries introducing some overhead, like always calling stat 
> when loading a file for instance.
> Also interestingly you say that Dart can allocate faster than 
> D? D’s allocation speed is usually part of its performance 
> advantage over other languages, since many other languages just 
> use C’s malloc. Do you know what Dart’s allocator is?

I use `dub build --build=release`, as explained in my project's 
README.

I don't know how Dart allocates, I presume it uses the JVM 
strategy of pre-allocating memory on the heap so each single 
allocation is practically free.


More information about the Digitalmars-d mailing list