Re: How to Declare a new pragma ?

2014-12-22 Thread FrankLike via Digitalmars-d-learn
On Monday, 22 December 2014 at 00:55:08 UTC, Mike Parker wrote: On 12/22/2014 9:21 AM, FrankLike wrote: Now ,x64 mainform always have the console window,and the entry is main. could you do it? Thank you. Since 64-bit DMD uses the Microsoft toolchain, you need to pass a

math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread Iov Gherman via Digitalmars-d-learn
Hi everybody, I am a java developer and used C/C++ only for some home projects so I never mastered native programming. I am currently learning D and I find it fascinating. I was reading the documentation about std.parallelism and I wanted to experiment a bit with the example Find the

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread bachmeier via Digitalmars-d-learn
On Monday, 22 December 2014 at 10:12:52 UTC, Iov Gherman wrote: Now, can anyone explain why this program ran faster in Java? I ran both programs multiple times and the results were always close to this execution times. Can the implementation of log() function be the reason for a slower

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread Daniel Kozak via Digitalmars-d-learn
I run Arch Linux on my PC. I compiled D programs using dmd-2.066 and used no compile arguments (dmd prog.d) You should try use some arguments -O -release -inline -noboundscheck and maybe try use gdc or ldc should help with performance can you post your code in all languages somewhere? I like

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread Daniel Kozak via Digitalmars-d-learn
On Monday, 22 December 2014 at 10:35:52 UTC, Daniel Kozak via Digitalmars-d-learn wrote: I run Arch Linux on my PC. I compiled D programs using dmd-2.066 and used no compile arguments (dmd prog.d) You should try use some arguments -O -release -inline -noboundscheck and maybe try use gdc or

Re: ini library in OSX

2014-12-22 Thread Robert burner Schadek via Digitalmars-d-learn
On Saturday, 20 December 2014 at 08:09:06 UTC, Joel wrote: On Monday, 13 October 2014 at 16:06:42 UTC, Robert burner Schadek wrote: On Saturday, 11 October 2014 at 22:38:20 UTC, Joel wrote: On Thursday, 11 September 2014 at 10:49:48 UTC, Robert burner Schadek wrote: some self promo:

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread Russel Winder via Digitalmars-d-learn
On Mon, 2014-12-22 at 10:12 +, Iov Gherman via Digitalmars-d-learn wrote: […] - D: 24 secs, 32 ms. - Java: 20 secs, 881 ms. - C: 21 secs - Go: 37 secs Without the source codes and the commands used to create and run, it is impossible to offer constructive criticism of the results.

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread aldanor via Digitalmars-d-learn
On Monday, 22 December 2014 at 11:11:07 UTC, aldanor wrote: Just tried it out myself (E5 Xeon / Linux): D version: 19.64 sec (avg 3 runs) import core.stdc.math; void main() { double s = 0; foreach (i; 1 .. 1_000_000_000) s += log(i); } // build

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread aldanor via Digitalmars-d-learn
On Monday, 22 December 2014 at 10:40:45 UTC, Daniel Kozak wrote: On Monday, 22 December 2014 at 10:35:52 UTC, Daniel Kozak via Digitalmars-d-learn wrote: I run Arch Linux on my PC. I compiled D programs using dmd-2.066 and used no compile arguments (dmd prog.d) You should try use some

Re: DUB build questions

2014-12-22 Thread uri via Digitalmars-d-learn
On Saturday, 20 December 2014 at 08:36:15 UTC, Russel Winder via Digitalmars-d-learn wrote: On Sat, 2014-12-20 at 05:46 +, Dicebot via Digitalmars-d-learn wrote: On Saturday, 20 December 2014 at 04:15:00 UTC, Rikki Cattermole wrote: b) Can I do parallel builds with dub. CMake gives me

optimization / benchmark tips a good topic for wiki ?

2014-12-22 Thread Laeeth Isharc via Digitalmars-d-learn
Replacing import core.stdc.math with import std.math in the D example increases the avg runtime from 19.64 to 23.87 seconds (~20% slower) which is consistent with OP's statement. + GDC/LDC vs DMD + nobounds, release Do you think we should start a topic on D wiki front page for

Re: DUB build questions

2014-12-22 Thread Rikki Cattermole via Digitalmars-d-learn
On 23/12/2014 1:39 a.m., uri wrote: On Saturday, 20 December 2014 at 08:36:15 UTC, Russel Winder via Digitalmars-d-learn wrote: On Sat, 2014-12-20 at 05:46 +, Dicebot via Digitalmars-d-learn wrote: On Saturday, 20 December 2014 at 04:15:00 UTC, Rikki Cattermole wrote: b) Can I do

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread Iov Gherman via Digitalmars-d-learn
Hi Guys, First of all, thank you all for responding so quick, it is so nice to see D having such an active community. As I said in my first post, I used no other parameters to dmd when compiling because I don't know too much about dmd compilation flags. I can't wait to try the flags Daniel

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread bachmeier via Digitalmars-d-learn
On Monday, 22 December 2014 at 17:05:19 UTC, Iov Gherman wrote: Hi Guys, First of all, thank you all for responding so quick, it is so nice to see D having such an active community. As I said in my first post, I used no other parameters to dmd when compiling because I don't know too much

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread Iov Gherman via Digitalmars-d-learn
On Monday, 22 December 2014 at 17:16:05 UTC, bachmeier wrote: On Monday, 22 December 2014 at 17:05:19 UTC, Iov Gherman wrote: Hi Guys, First of all, thank you all for responding so quick, it is so nice to see D having such an active community. As I said in my first post, I used no other

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread Iov Gherman via Digitalmars-d-learn
So, I did some more testing with the one processing in paralel: --- dmd: 4 secs, 977 ms --- dmd with flags: -O -release -inline -noboundscheck: 4 secs, 635 ms --- ldc: 6 secs, 271 ms --- gdc: 10 secs, 439 ms I also pushed the new bash scripts to the git repository.

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread John Colvin via Digitalmars-d-learn
On Monday, 22 December 2014 at 17:28:12 UTC, Iov Gherman wrote: So, I did some more testing with the one processing in paralel: --- dmd: 4 secs, 977 ms --- dmd with flags: -O -release -inline -noboundscheck: 4 secs, 635 ms --- ldc: 6 secs, 271 ms --- gdc: 10 secs, 439 ms I also pushed the

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread aldanor via Digitalmars-d-learn
On Monday, 22 December 2014 at 17:28:12 UTC, Iov Gherman wrote: So, I did some more testing with the one processing in paralel: --- dmd: 4 secs, 977 ms --- dmd with flags: -O -release -inline -noboundscheck: 4 secs, 635 ms --- ldc: 6 secs, 271 ms --- gdc: 10 secs, 439 ms I also pushed the

Re: Inheritance and in-contracts

2014-12-22 Thread aldanor via Digitalmars-d-learn
https://github.com/D-Programming-Language/dmd/pull/4200

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread Iov Gherman via Digitalmars-d-learn
On Monday, 22 December 2014 at 18:00:18 UTC, aldanor wrote: On Monday, 22 December 2014 at 17:28:12 UTC, Iov Gherman wrote: So, I did some more testing with the one processing in paralel: --- dmd: 4 secs, 977 ms --- dmd with flags: -O -release -inline -noboundscheck: 4 secs, 635 ms --- ldc:

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread Iov Gherman via Digitalmars-d-learn
On Monday, 22 December 2014 at 17:50:20 UTC, John Colvin wrote: On Monday, 22 December 2014 at 17:28:12 UTC, Iov Gherman wrote: So, I did some more testing with the one processing in paralel: --- dmd: 4 secs, 977 ms --- dmd with flags: -O -release -inline -noboundscheck: 4 secs, 635 ms ---

Re: Inheritance and in-contracts

2014-12-22 Thread aldanor via Digitalmars-d-learn
On Monday, 22 December 2014 at 19:11:13 UTC, Ali Çehreli wrote: On 12/22/2014 10:06 AM, aldanor wrote: https://github.com/D-Programming-Language/dmd/pull/4200 Thank you! This fixes a big problem with the contracts in D. Ali It's not my PR but I just thought this thread would be happy to

Re: Inheritance and in-contracts

2014-12-22 Thread Ali Çehreli via Digitalmars-d-learn
On 12/22/2014 10:06 AM, aldanor wrote: https://github.com/D-Programming-Language/dmd/pull/4200 Thank you! This fixes a big problem with the contracts in D. Ali

Re: Inheritance and in-contracts

2014-12-22 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
On 22/12/14 19:06, aldanor via Digitalmars-d-learn wrote: https://github.com/D-Programming-Language/dmd/pull/4200 Yes, I saw that PR with some joy -- thanks for the link! :-)

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread via Digitalmars-d-learn
On Monday, 22 December 2014 at 18:23:29 UTC, Iov Gherman wrote: On Monday, 22 December 2014 at 18:00:18 UTC, aldanor wrote: On Monday, 22 December 2014 at 17:28:12 UTC, Iov Gherman wrote: So, I did some more testing with the one processing in paralel: --- dmd: 4 secs, 977 ms --- dmd with

Re: Inheritance and in-contracts

2014-12-22 Thread Joseph Rushton Wakeling via Digitalmars-d-learn
On 22/12/14 20:12, aldanor via Digitalmars-d-learn wrote: On Monday, 22 December 2014 at 19:11:13 UTC, Ali Çehreli wrote: On 12/22/2014 10:06 AM, aldanor wrote: https://github.com/D-Programming-Language/dmd/pull/4200 Thank you! This fixes a big problem with the contracts in D. Ali It's

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread John Colvin via Digitalmars-d-learn
On Monday, 22 December 2014 at 18:27:48 UTC, Iov Gherman wrote: On Monday, 22 December 2014 at 17:50:20 UTC, John Colvin wrote: On Monday, 22 December 2014 at 17:28:12 UTC, Iov Gherman wrote: So, I did some more testing with the one processing in paralel: --- dmd: 4 secs, 977 ms --- dmd

How to get the processid by exe's name in D?

2014-12-22 Thread FrankLike via Digitalmars-d-learn
Now,if you want to know whether a exe is in processes ,you must use the win API.Do you have any other idea?

Re: How to get the processid by exe's name in D?

2014-12-22 Thread Adam D. Ruppe via Digitalmars-d-learn
The windows api is how I'd do it - look up how to do it in C, then do the same thing in D.

Re: math.log() benchmark of first 1 billion int using std.parallelism

2014-12-22 Thread Daniel Kozak via Digitalmars-d-learn
That's very different to my results. I see no important difference between ldc and dmd when using std.math, but when using core.stdc.math ldc halves its time where dmd only manages to get to ~80% What CPU do you have? On my Intel Core i3 I have similar experience as Iov Gherman, but on my

Re: ini library in OSX

2014-12-22 Thread Joel via Digitalmars-d-learn
On Monday, 22 December 2014 at 11:04:10 UTC, Robert burner Schadek wrote: On Saturday, 20 December 2014 at 08:09:06 UTC, Joel wrote: On Monday, 13 October 2014 at 16:06:42 UTC, Robert burner Schadek wrote: On Saturday, 11 October 2014 at 22:38:20 UTC, Joel wrote: On Thursday, 11 September 2014