Programs in D are huge

2022-08-16 Thread Diego via Digitalmars-d-learn
Hello everyone, I'm a Java programmer at work but i'm learning D for pleasure. I'm reading _The D Programming Language by Ali Çehreli_. I noticed that DMD creates very huge executable, for example an empty program: ``` empty.d: void main() { } ``` after a compilation with these

Re: Programs in D are huge

2022-08-16 Thread Dennis via Digitalmars-d-learn
On Tuesday, 16 August 2022 at 08:25:18 UTC, Diego wrote: It seams huge in my opinion for an empty program What are the best practices to reduce the size? The problem is that the druntime, the run time library needed to support many D features, is large and linked in its entirety by default.

Re: Programs in D are huge

2022-08-16 Thread user1234 via Digitalmars-d-learn
On Tuesday, 16 August 2022 at 08:25:18 UTC, Diego wrote: Hello everyone, I'm a Java programmer at work but i'm learning D for pleasure. I'm reading _The D Programming Language by Ali Çehreli_. I noticed that DMD creates very huge executable, for example an empty program: ``` empty.d:

Re: Programs in D are huge

2022-08-16 Thread Salih Dincer via Digitalmars-d-learn
On Tuesday, 16 August 2022 at 08:25:18 UTC, Diego wrote: after a compilation with these flags `dmd -de -w empty.d` i have an executable of 869KiB It seams huge in my opinion for an empty program What are the best practices to reduce the size? If compile speed and verbose error codes are not

Re: How long will DUB update a package from github release?

2022-08-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/15/22 10:12 PM, Domain wrote: The project [Lumars](https://code.dlang.org/packages/lumars) has released a new version 10 days ago in [github](https://github.com/BradleyChatha/lumars). But still unavailable in DUB. It should be done automatically, but this has been an intermittent

Re: Programs in D are huge

2022-08-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/16/22 4:25 AM, Diego wrote: Hello everyone, I'm a Java programmer at work but i'm learning D for pleasure. I'm reading _The D Programming Language by Ali Çehreli_. I noticed that DMD creates very huge executable, for example an empty program: ``` empty.d: void main() { } ``` after

Re: In-place extension of arrays only for certain alignment?

2022-08-16 Thread Salih Dincer via Digitalmars-d-learn
On Tuesday, 16 August 2022 at 18:11:54 UTC, Ali Çehreli wrote: ```d version (good) { // Dropping front elements equaling 2048 bytes works. // (Likely a GC magic constant.) enum magic = 2048; enum elementsPerPage = magic / S.sizeof; if (arr.length ==

Re: In-place extension of arrays only for certain alignment?

2022-08-16 Thread Ali Çehreli via Digitalmars-d-learn
Thank you for the quick response. On 8/16/22 12:31, Steven Schveighoffer wrote: > On 8/16/22 2:11 PM, Ali Çehreli wrote: >> Related to my DConf 2022 lightning talk, I am noticing that D >> runtime's in-place array extension optimization is available only for >> array data that are at certain

Re: In-place extension of arrays only for certain alignment?

2022-08-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/16/22 4:53 PM, Ali Çehreli wrote: On 8/16/22 12:31, Steven Schveighoffer wrote: > > No, it's based on 2 factors: > > 1. Is it a page-size-or-greater block? I assume the length of the new block. No, the length of the *existing* block. Everything in the memory allocator is in terms of

In-place extension of arrays only for certain alignment?

2022-08-16 Thread Ali Çehreli via Digitalmars-d-learn
Related to my DConf 2022 lightning talk, I am noticing that D runtime's in-place array extension optimization is available only for array data that are at certain memory alignments. I used the following program to test it. In addition to repeatedly adding an element to an array, - 'version

Re: In-place extension of arrays only for certain alignment?

2022-08-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/16/22 2:11 PM, Ali Çehreli wrote: Related to my DConf 2022 lightning talk, I am noticing that D runtime's in-place array extension optimization is available only for array data that are at certain memory alignments. No, it's based on 2 factors: 1. Is it a page-size-or-greater block?