Re: Performance issue with fiber

2021-07-30 Thread hanabi1224 via Digitalmars-d-learn
On Friday, 30 July 2021 at 14:41:06 UTC, Daniel Kozak wrote: I have rewrite it to be same as dart version Thanks! There're both generator version and fiber version on the site(if possible), the 2 versions are not really comparable to each other (generator solutions should be much faster). The

Re: Performance issue with fiber

2021-07-30 Thread Daniel Kozak via Digitalmars-d-learn
On Wed, Jul 28, 2021 at 11:41 PM hanabi1224 via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > On Wednesday, 28 July 2021 at 16:26:49 UTC, drug wrote: > > I profiled the provided example (not `FiberScheduler`) using > > perf. Both dmd and ldc2 gave the same result - `void > > fi

Re: Performance issue with fiber

2021-07-28 Thread hanabi1224 via Digitalmars-d-learn
On Wednesday, 28 July 2021 at 16:26:49 UTC, drug wrote: I profiled the provided example (not `FiberScheduler`) using perf. Both dmd and ldc2 gave the same result - `void filterInner(int, int)` took ~90% of the run time. The time was divided between: `int std.concurrency.receiveOnly!(in

Re: Performance issue with fiber

2021-07-28 Thread hanabi1224 via Digitalmars-d-learn
On Wednesday, 28 July 2021 at 16:31:49 UTC, Ali Çehreli wrote: I assume the opposite because normally, the number of times a thread or fiber is spawned is nothing compared to the number of times they are context-switched. So, spawning can be expensive and nobody would realize as long as switchi

Re: Performance issue with fiber

2021-07-28 Thread hanabi1224 via Digitalmars-d-learn
On Wednesday, 28 July 2021 at 14:39:29 UTC, Mathias LANG wrote: Hence doing: ```diff - auto scheduler = new FiberScheduler(); + scheduler = new FiberScheduler(); ``` Thanks for pointing it out! Looks like I was benchmarking thread instead of fiber. I just made the change you suggest but the r

Re: Performance issue with fiber

2021-07-28 Thread Ali Çehreli via Digitalmars-d-learn
On 7/28/21 1:15 AM, hanabi1224 wrote: > On Wednesday, 28 July 2021 at 01:12:16 UTC, Denis Feklushkin wrote: >> Spawning fiber is expensive > > Sorry but I cannot agree with the logic behind this statement, the whole > point of using fiber is that, spwaning system thread is expensive, thus > ppl c

Re: Performance issue with fiber

2021-07-28 Thread drug via Digitalmars-d-learn
28.07.2021 17:39, Mathias LANG пишет: On Wednesday, 21 July 2021 at 22:51:38 UTC, hanabi1224 wrote: Hi, I'm new to D lang and encounter some performance issues with fiber, not sure if there's something obviously wrong with my code. I took a quick look, and the first problem I saw was that you

Re: Performance issue with fiber

2021-07-28 Thread Mathias LANG via Digitalmars-d-learn
On Wednesday, 21 July 2021 at 22:51:38 UTC, hanabi1224 wrote: Hi, I'm new to D lang and encounter some performance issues with fiber, not sure if there's something obviously wrong with my code. I took a quick look, and the first problem I saw was that you were using `spawnLinked` but not repl

Re: Performance issue with fiber

2021-07-28 Thread James Blachly via Digitalmars-d-learn
On 7/27/21 9:12 PM, Denis Feklushkin wrote: Spawning fiber is expensive (but not so expensive as spawning thread, of course), but switching is fast. Thus, you can spawn and pause "workers" fibers for avaiting of jobs. (Probably, this behaviour is already implemented in number of libraries and

Re: Performance issue with fiber

2021-07-28 Thread hanabi1224 via Digitalmars-d-learn
On Wednesday, 28 July 2021 at 01:12:16 UTC, Denis Feklushkin wrote: Spawning fiber is expensive Sorry but I cannot agree with the logic behind this statement, the whole point of using fiber is that, spwaning system thread is expensive, thus ppl create lightweight thread 'fiber', then if a 'f

Re: Performance issue with fiber

2021-07-27 Thread Denis Feklushkin via Digitalmars-d-learn
On Monday, 26 July 2021 at 12:09:07 UTC, hanabi1224 wrote: Thank you for your response! I've got some questions tho. On Saturday, 24 July 2021 at 09:17:47 UTC, Stefan Koch wrote: It will not use a fiber pool. Why fiber pool? Isn't fiber a lightweight logical thread which is already implemen

Re: Performance issue with fiber

2021-07-26 Thread jfondren via Digitalmars-d-learn
On Monday, 26 July 2021 at 15:27:48 UTC, russhy wrote: ``` build: ``` dub build --compiler=ldc -brelease --single primesv1.d ``` -brelease is a typo issue, i don't think that produce defired effect, most likely it defaulted to debug build it should be -b release No, it builds a release

Re: Performance issue with fiber

2021-07-26 Thread russhy via Digitalmars-d-learn
``` build: ``` dub build --compiler=ldc -brelease --single primesv1.d ``` -brelease is a typo issue, i don't think that produce defired effect, most likely it defaulted to debug build it should be -b release

Re: Performance issue with fiber

2021-07-26 Thread hanabi1224 via Digitalmars-d-learn
Thank you for your response! I've got some questions tho. On Saturday, 24 July 2021 at 09:17:47 UTC, Stefan Koch wrote: It will not use a fiber pool. Why fiber pool? Isn't fiber a lightweight logical thread which is already implemented with thread pool internally? Spawning a new fiber is e

Re: Performance issue with fiber

2021-07-24 Thread jfondren via Digitalmars-d-learn
On Saturday, 24 July 2021 at 09:17:47 UTC, Stefan Koch wrote: On Wednesday, 21 July 2021 at 22:51:38 UTC, hanabi1224 wrote: Hi, I'm new to D lang and encounter some performance issues with fiber, not sure if there's something obviously wrong with my code. There is your problem. auto sc

Re: Performance issue with fiber

2021-07-24 Thread Stefan Koch via Digitalmars-d-learn
On Wednesday, 21 July 2021 at 22:51:38 UTC, hanabi1224 wrote: Hi, I'm new to D lang and encounter some performance issues with fiber, not sure if there's something obviously wrong with my code. There is your problem. auto scheduler = new FiberScheduler; The Fiber scheduler will spawn

Re: Performance issue with fiber

2021-07-21 Thread seany via Digitalmars-d-learn
On Wednesday, 21 July 2021 at 22:51:38 UTC, hanabi1224 wrote: Hi, I'm new to D lang and encounter some performance issues with fiber, not sure if there's something obviously wrong with my code. [...] Following. I am also in need of more information to increase speed of D binaries using par

Performance issue with fiber

2021-07-21 Thread hanabi1224 via Digitalmars-d-learn
Hi, I'm new to D lang and encounter some performance issues with fiber, not sure if there's something obviously wrong with my code. Basically, I found D lang's logical thread communication is quite like Elixir's (process), I have programs written in both D and Elixir but the D version (release

Re: Performance Issue

2017-09-06 Thread Vino.B via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 18:44:26 UTC, Azi Hassan wrote: On Wednesday, 6 September 2017 at 18:21:44 UTC, Azi Hassan wrote: I tried to create a similar file structure on my Linux machine. Here's the result of ls -R TEST1: TEST1: BACKUP ... Upon further inspection it looks like I mess

Re: Performance Issue

2017-09-06 Thread Azi Hassan via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 18:21:44 UTC, Azi Hassan wrote: I tried to create a similar file structure on my Linux machine. Here's the result of ls -R TEST1: TEST1: BACKUP ... Upon further inspection it looks like I messed up the output. [31460] - Array 1 for folder 1(all files in Fol

Re: Performance Issue

2017-09-06 Thread Azi Hassan via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 15:11:57 UTC, Vino.B wrote: On Wednesday, 6 September 2017 at 14:38:39 UTC, Vino.B wrote: Hi Azi, The required out is like below [31460] - Array 1 for folder 1(all files in Folder 1) of the FS C:\\Temp\\TEST1\\BACKUP [138] - Array 2 for folder 2(all fi

Re: Performance Issue

2017-09-06 Thread Vino.B via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 14:38:39 UTC, Vino.B wrote: On Wednesday, 6 September 2017 at 10:58:25 UTC, Azi Hassan wrote: [...] Hi Azi, Your are correct, i tried to implement the fold in a separate small program as below, but not able to get the the required output, when you execute

Re: Performance Issue

2017-09-06 Thread Vino.B via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 10:58:25 UTC, Azi Hassan wrote: On Wednesday, 6 September 2017 at 08:10:35 UTC, Vino.B wrote: in the next line of the code i say to list only folders that are greater than 10 Mb but this now is listing all folder (folder whose size is less than 10 MB are gettin

Re: Performance Issue

2017-09-06 Thread Azi Hassan via Digitalmars-d-learn
On Wednesday, 6 September 2017 at 08:10:35 UTC, Vino.B wrote: in the next line of the code i say to list only folders that are greater than 10 Mb but this now is listing all folder (folder whose size is less than 10 MB are getting listed, not sure why. Is the size in GB ? If so, then subdirTo

Re: Performance Issue

2017-09-06 Thread user1234 via Digitalmars-d-learn
On Tuesday, 5 September 2017 at 09:44:09 UTC, Vino.B wrote: Hi, The below code is consume more memory and slower can you provide your suggestion on how to over come these issues. string[][] csizeDirList (string FFs, int SizeDir) { ulong subdirTotal = 0; ulong subdirTotalGB;

Re: Performance Issue

2017-09-06 Thread Vino.B via Digitalmars-d-learn
On Tuesday, 5 September 2017 at 10:28:28 UTC, Stefan Koch wrote: On Tuesday, 5 September 2017 at 09:44:09 UTC, Vino.B wrote: Hi, The below code is consume more memory and slower can you provide your suggestion on how to over come these issues. [...] Much slower then ? Hi, This code i

Re: Performance Issue

2017-09-05 Thread Azi Hassan via Digitalmars-d-learn
On Tuesday, 5 September 2017 at 09:44:09 UTC, Vino.B wrote: Hi, The below code is consume more memory and slower can you provide your suggestion on how to over come these issues. You can start by dropping the .array conversions after dirEntries. That way your algorithm will become lazy (as

Re: Performance Issue

2017-09-05 Thread Stefan Koch via Digitalmars-d-learn
On Tuesday, 5 September 2017 at 09:44:09 UTC, Vino.B wrote: Hi, The below code is consume more memory and slower can you provide your suggestion on how to over come these issues. [...] Much slower then ?

Performance Issue

2017-09-05 Thread Vino.B via Digitalmars-d-learn
Hi, The below code is consume more memory and slower can you provide your suggestion on how to over come these issues. string[][] csizeDirList (string FFs, int SizeDir) { ulong subdirTotal = 0; ulong subdirTotalGB; auto Subdata = appender!(string[][]); auto dFiles

Re: Performance issue with GC

2016-09-07 Thread Yuxuan Shui via Digitalmars-d-learn
On Wednesday, 7 September 2016 at 22:54:14 UTC, Basile B. wrote: On Wednesday, 7 September 2016 at 21:20:30 UTC, Yuxuan Shui wrote: I have a little data processing program which makes heavy use of associative arrays, and GC almost doubles the runtime of it (~2m with GC disabled -> ~4m). I jus

Re: Performance issue with GC

2016-09-07 Thread Basile B. via Digitalmars-d-learn
On Wednesday, 7 September 2016 at 21:20:30 UTC, Yuxuan Shui wrote: I have a little data processing program which makes heavy use of associative arrays, and GC almost doubles the runtime of it (~2m with GC disabled -> ~4m). I just want to ask what's the best practice in this situation? Do I ju

Performance issue with GC

2016-09-07 Thread Yuxuan Shui via Digitalmars-d-learn
I have a little data processing program which makes heavy use of associative arrays, and GC almost doubles the runtime of it (~2m with GC disabled -> ~4m). I just want to ask what's the best practice in this situation? Do I just use GC.disable and manually run GC.collect periodically?