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

Renato renato at athaydes.com
Sun Aug 25 18:31:26 UTC 2024


On Thursday, 22 August 2024 at 21:54:33 UTC, IchorDev wrote:
> On Thursday, 22 August 2024 at 16:21:45 UTC, Renato Athaydes 
> wrote:
>> I use `dub build --build=release`, as explained in my 
>> project's README.
>
> That doesn’t tell me which compiler you’re using.

I already told you (just check previous messages). Latest DMD, 
latest LDC2.

I ran with -v and it spills out the compiler flags it sets, if 
you're really interested in that:

```
  -release -inline -O -w -version=Have_dar -Isource/ source/app.d 
source/dar.d -c -vcolumns
```

Seems like a pretty good combination.

By the way, as I've gone through the D Book, I noticed I could 
get a `InputRange` implemented by simpler blocking code that uses 
Fibers, so I made a change to use `std.concurrency.Generator` and 
I am happier with the code using that (implementing the range 
methods kind of sucks IMO):

https://github.com/renatoathaydes/dar/pull/2/files

Performance seems to be the same, though the runtime varies 
considerably between runs... the RAM usage is the same (very low, 
like 1MB for parsing a 20MB file).

> It should say when you run dub, or if not you can see the 
> commands it runs using `-v`. If it’s dmd then I guess Google 
> must be hiring monkeys to sit at typewriters over there or 
> something.

I don't understand what you're suggesting. Are you trying to say 
Google employees are stupid because Dart is slower than D on this 
particular completely unfair and unscientific comparison? I don't 
think that's a reasonable assessment.

>> I don't know how Dart allocates
>
> Oh well!

Anyway, I found the benchmark where Dart is 2x faster than D, and 
faster than Java as well (but Java was closer): 
https://github.com/hanabi1224/Programming-Language-Benchmarks/issues/378

As I mentioned on that Thread, in which the other person 
unfortunately became defensive ( I was actually trying to make 
the D example faster as the results didn't make any sense to me 
at the time, I did expect D to win by far ), the HTTP server in 
Dart is also quite a bit faster than D's (at least the solutions 
submitted in the Programming Languages Benchmarks). Just goes to 
show that things are not as simple as "Language X is faster than 
Y".




More information about the Digitalmars-d mailing list