Re: Read text file fast, how?

2015-07-30 Thread Andrei Alexandrescu via Digitalmars-d
On 7/27/15 8:03 AM, Johan Holmberg via Digitalmars-d wrote: On Sun, Jul 26, 2015 at 5:36 PM, Andrei Alexandrescu via Digitalmars-d mailto:digitalmars-d@puremagic.com>> wrote: On 7/26/15 10:35 AM, Johan Holmberg via Digitalmars-d wrote: On Sat, Jul 25, 2015 at 10:12 PM, Andrei Ale

Re: Read text file fast, how?

2015-07-29 Thread Jacob Carlborg via Digitalmars-d
On 2015-07-29 19:02, Johan Holmberg via Digitalmars-d wrote: Is there a LDC that incorporates the changes coming in DMD 2.068 that made my code run 10x faster compared with 2.067? I would guess that there isn't. -- /Jacob Carlborg

Re: Read text file fast, how?

2015-07-29 Thread Johan Holmberg via Digitalmars-d
On Wed, Jul 29, 2015 at 11:47 AM, Jacob Carlborg via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On 2015-07-27 14:03, Johan Holmberg via Digitalmars-d wrote: > >> The timings running my program normally (not using Instruments now), >> became as follows with the different versions of dmd:

Re: Read text file fast, how?

2015-07-29 Thread Jacob Carlborg via Digitalmars-d
On 2015-07-27 14:03, Johan Holmberg via Digitalmars-d wrote: Back on MacOS again, I thought I should try to run "Instruments" on my program. I'm not familiar with the DMD source code, but I did the following: - downloaded the DMD source from Github + built it - rebuilt my program with this dmd

Re: Read text file fast, how?

2015-07-27 Thread Jesse Phillips via Digitalmars-d
On Monday, 27 July 2015 at 08:52:07 UTC, Martin Nowak wrote: On 07/26/2015 09:04 PM, Jesse Phillips wrote: It would be better to compare with LDC or GDC to match the same backend as C++. That is a little harder since they don't have 2.068 yet. Reading a file is IO and memcpy limited, has no

Re: Read text file fast, how?

2015-07-27 Thread Tobias Müller via Digitalmars-d
Martin Nowak wrote: > On 07/26/2015 09:04 PM, Jesse Phillips wrote: >> >> It would be better to compare with LDC or GDC to match the same backend >> as C++. That is a little harder since they don't have 2.068 yet. > > Reading a file is IO and memcpy limited, has nothing to do with compiler > opt

Re: Read text file fast, how?

2015-07-27 Thread Johan Holmberg via Digitalmars-d
On Mon, Jul 27, 2015 at 11:03 AM, via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > Are you including program startup and exit in the timing? For comparison, > can you include the timings of an empty do-nothing program in all the > languages? > Yes, I measure the whole program. But these

Re: Read text file fast, how?

2015-07-27 Thread John Colvin via Digitalmars-d
On Monday, 27 July 2015 at 12:03:40 UTC, Johan Holmberg wrote: On Sun, Jul 26, 2015 at 5:36 PM, Andrei Alexandrescu via Digitalmars-d < digitalmars-d@puremagic.com> wrote: [...] Back on MacOS again, I thought I should try to run "Instruments" on my program. I'm not familiar with the DMD s

Re: Read text file fast, how?

2015-07-27 Thread Johan Holmberg via Digitalmars-d
On Sun, Jul 26, 2015 at 5:36 PM, Andrei Alexandrescu via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On 7/26/15 10:35 AM, Johan Holmberg via Digitalmars-d wrote: > >> >> On Sat, Jul 25, 2015 at 10:12 PM, Andrei Alexandrescu via Digitalmars-d >> mailto:digitalmars-d@puremagic.com>> wrote:

Re: Read text file fast, how?

2015-07-27 Thread via Digitalmars-d
Are you including program startup and exit in the timing? For comparison, can you include the timings of an empty do-nothing program in all the languages?

Re: Read text file fast, how?

2015-07-27 Thread Martin Nowak via Digitalmars-d
On 07/26/2015 09:04 PM, Jesse Phillips wrote: > > It would be better to compare with LDC or GDC to match the same backend > as C++. That is a little harder since they don't have 2.068 yet. Reading a file is IO and memcpy limited, has nothing to do with compiler optimizations. Clearly we must be d

Re: Read text file fast, how?

2015-07-26 Thread Jesse Phillips via Digitalmars-d
On Sunday, 26 July 2015 at 14:36:09 UTC, Johan Holmberg wrote: C++ with style IO:0.40s C++ with style IO: 0.31s D 2.0671.75s D 2.068 beta 2:0.69s Perl: 1.49s Python:

Re: Read text file fast, how?

2015-07-26 Thread Brandon Ragland via Digitalmars-d
On Sunday, 26 July 2015 at 15:36:29 UTC, Andrei Alexandrescu wrote: On 7/26/15 10:35 AM, Johan Holmberg via Digitalmars-d wrote: [...] I think we should investigate this and bring performance to par. Anyone interested? -- Andrei Here's the link to the fstream libstc++ source for GNU /linux

Re: Read text file fast, how?

2015-07-26 Thread Bigsandwich via Digitalmars-d
On Sunday, 26 July 2015 at 14:36:09 UTC, Johan Holmberg wrote: On Sat, Jul 25, 2015 at 10:12 PM, Andrei Alexandrescu via Digitalmars-d < digitalmars-d@puremagic.com> wrote: [...] My C++ program was actually doing C-style IO via . I didn't think about the distinction C/C++ when reporting the

Re: Read text file fast, how?

2015-07-26 Thread Andrei Alexandrescu via Digitalmars-d
On 7/26/15 10:35 AM, Johan Holmberg via Digitalmars-d wrote: On Sat, Jul 25, 2015 at 10:12 PM, Andrei Alexandrescu via Digitalmars-d mailto:digitalmars-d@puremagic.com>> wrote: On 7/25/15 1:53 PM, Johan Holmberg via Digitalmars-d wrote: Thanks, my question seems like a carbon copy

Re: Read text file fast, how?

2015-07-26 Thread Johan Holmberg via Digitalmars-d
On Sat, Jul 25, 2015 at 10:12 PM, Andrei Alexandrescu via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On 7/25/15 1:53 PM, Johan Holmberg via Digitalmars-d wrote: > >> Thanks, my question seems like a carbon copy of the Stack Overflow >> article :) Somehow I had missed it when googling. >

Re: Read text file fast, how?

2015-07-25 Thread sigod via Digitalmars-d
On Saturday, 25 July 2015 at 22:40:55 UTC, Brandon Ragland wrote: On Saturday, 25 July 2015 at 20:12:26 UTC, Andrei Alexandrescu wrote: On 7/25/15 1:53 PM, Johan Holmberg via Digitalmars-d wrote: Thanks, my question seems like a carbon copy of the Stack Overflow article :) Somehow I had missed

Re: Read text file fast, how?

2015-07-25 Thread Brandon Ragland via Digitalmars-d
On Saturday, 25 July 2015 at 20:12:26 UTC, Andrei Alexandrescu wrote: On 7/25/15 1:53 PM, Johan Holmberg via Digitalmars-d wrote: Thanks, my question seems like a carbon copy of the Stack Overflow article :) Somehow I had missed it when googling. I download a dmd 2.068 beta, and re-tried with

Re: Read text file fast, how?

2015-07-25 Thread Andrei Alexandrescu via Digitalmars-d
On 7/25/15 1:53 PM, Johan Holmberg via Digitalmars-d wrote: Thanks, my question seems like a carbon copy of the Stack Overflow article :) Somehow I had missed it when googling. I download a dmd 2.068 beta, and re-tried with my input file: now the D program takes 1.6s (a 10x improvement). Great

Re: Read text file fast, how?

2015-07-25 Thread Johan Holmberg via Digitalmars-d
On Sat, Jul 25, 2015 at 7:14 PM, Andrei Alexandrescu via Digitalmars-d < digitalmars-d@puremagic.com> wrote: > On 7/25/15 8:19 AM, Johan Holmberg via Digitalmars-d wrote: > >> Hi! >> >> I am trying to port a program I have written earlier to D. My previous >> versions are in C++ and Python. I was

Re: Read text file fast, how?

2015-07-25 Thread Andrei Alexandrescu via Digitalmars-d
On 7/25/15 8:19 AM, Johan Holmberg via Digitalmars-d wrote: Hi! I am trying to port a program I have written earlier to D. My previous versions are in C++ and Python. I was hoping that a D version would be similar in speed to the C++ version, rather than similar to the Python version. But curren

Read text file fast, how?

2015-07-25 Thread Johan Holmberg via Digitalmars-d
Hi! I am trying to port a program I have written earlier to D. My previous versions are in C++ and Python. I was hoping that a D version would be similar in speed to the C++ version, rather than similar to the Python version. But currently it isn't. Part of the problem may be that I haven't learn