Re: Options for unit testing in D?

2019-06-22 Thread Mike Brockus via Digitalmars-d-learn
On Saturday, 22 June 2019 at 13:51:10 UTC, Paul Backus wrote: On Friday, 21 June 2019 at 22:35:55 UTC, Mike Brockus wrote: On Friday, 21 June 2019 at 17:52:43 UTC, Mike Wey wrote: On 21-06-2019 06:08, Mike Brockus wrote: [...] If you are using the D unittests in your source you can

Re: Best practices of using const

2019-06-22 Thread Bart via Digitalmars-d-learn
On Wednesday, 13 February 2019 at 16:40:18 UTC, H. S. Teoh wrote: So ironically, the iron-clad semantics of D's const system turns out to be also its own downfall. Such things are not ironic. There is always a trade off. You get nothing for free in this universe. Physics tells us this.

Re: Closures and memory allocation

2019-06-22 Thread kinke via Digitalmars-d-learn
On Saturday, 22 June 2019 at 16:52:07 UTC, Anonymouse wrote: When entering the following function, does it allocate: 1. 0 times, because while there are closures defined, none is ever called? 2. 2 times, because there are closures over two variables? 3. 20 times, because there are 20 unique

Re: Closures and memory allocation

2019-06-22 Thread Cym13 via Digitalmars-d-learn
On Saturday, 22 June 2019 at 19:26:13 UTC, Cym13 wrote: On Saturday, 22 June 2019 at 16:52:07 UTC, Anonymouse wrote: [...] Clearly this is a good time for you to learn about the tools D offers to profile allocations. There is the --profile=gc DMD argument that you can use but here there's

Re: Closures and memory allocation

2019-06-22 Thread Cym13 via Digitalmars-d-learn
On Saturday, 22 June 2019 at 16:52:07 UTC, Anonymouse wrote: I'm looking into why my thing does so many memory allocations. Profiling with kcachegrind shows _d_allocmemory being called upon entering a certain function, lots and lots of times. It's a function that receives concurrency

Closures and memory allocation

2019-06-22 Thread Anonymouse via Digitalmars-d-learn
I'm looking into why my thing does so many memory allocations. Profiling with kcachegrind shows _d_allocmemory being called upon entering a certain function, lots and lots of times. It's a function that receives concurrency messages, so it contains nested functions that close over local

Re: Options for unit testing in D?

2019-06-22 Thread Paul Backus via Digitalmars-d-learn
On Friday, 21 June 2019 at 22:35:55 UTC, Mike Brockus wrote: On Friday, 21 June 2019 at 17:52:43 UTC, Mike Wey wrote: On 21-06-2019 06:08, Mike Brockus wrote: [...] If you are using the D unittests in your source you can recompile the same source with `d_unittest: true`, the

Re: There is a computer languages benchmark compare site, but no Dlang benchmark. I think they should support D.

2019-06-22 Thread Kagamin via Digitalmars-d-learn
On Saturday, 22 June 2019 at 01:27:31 UTC, lili wrote: A nick site, has a lot of languages, unfortunately no dlang in there. https://benchmarksgame-team.pages.debian.net/benchmarksgame/ See https://github.com/kostya/benchmarks

Re: Best practices of using const

2019-06-22 Thread Yatheendra via Digitalmars-d-learn
On Saturday, 22 June 2019 at 05:10:14 UTC, Yatheendra wrote: It feels disingenous to want to call a caching object even "logically" const. There has to be a scaffolding-based but hopefully generic compromise. I haven't yet tested this belief, but I believe "physical" const is of good use