pause garbage collection in parallel code

2014-12-15 Thread Stephan Schiffels via Digitalmars-d
Dear all, I have a parallel program, using std.parallelism (awesome!), but I recently noticed that I achieve very poor performance on many CPUs, and I identified the Garbage Collector to be the main cause of this. Because I have quite heavy memory usage, the Garbage collector interrupts all

Re: pause garbage collection in parallel code

2014-12-15 Thread Stephan Schiffels via Digitalmars-d
On Monday, 15 December 2014 at 11:54:44 UTC, Daniel Murphy wrote: Stephan Schiffels wrote in message news:wjeozpnitvhtxrkhu...@forum.dlang.org... I see several ways how to improve my code: 1.) Is there a way to tell the GC the maximum heap size allowed before it initiates a collection cycle

Re: pause garbage collection in parallel code

2014-12-15 Thread Stephan Schiffels via Digitalmars-d
On Monday, 15 December 2014 at 11:54:44 UTC, Daniel Murphy wrote: Stephan Schiffels wrote in message news:wjeozpnitvhtxrkhu...@forum.dlang.org... I see several ways how to improve my code: 1.) Is there a way to tell the GC the maximum heap size allowed before it initiates a collection cycle

stack trace output on exception

2014-07-08 Thread Stephan Schiffels via Digitalmars-d-learn
Hi, I am using dmd with version: DMD64 D Compiler v2.065-devel-db2a73d My program throws a custom exception with a custom error message at some point. The stack trace (below) is very uninformative. Is there a way to output the function names of each position in the stack? I already compile

Re: stack trace output on exception

2014-07-08 Thread Stephan Schiffels via Digitalmars-d-learn
Ah nice. That worked. Thanks! 2014-07-08 9:25 GMT+02:00 JR via Digitalmars-d-learn digitalmars-d-learn@puremagic.com: On Tuesday, 8 July 2014 at 07:11:26 UTC, Stephan Schiffels wrote: Hi, I am using dmd with version: DMD64 D Compiler v2.065-devel-db2a73d My program throws a custom

Re: Read and write gzip files easily.

2014-02-20 Thread Stephan Schiffels
On Wednesday, 19 February 2014 at 15:51:53 UTC, Kamil Slowikowski wrote: Hi there, I'm new to D and have a lot of learning ahead of me. It would be extremely helpful to me if someone with D experience could show me some code examples. I'd like to neatly read and write gzipped files for my

Re: Read and write gzip files easily.

2014-02-20 Thread Stephan Schiffels
On Thursday, 20 February 2014 at 17:05:37 UTC, Kamil Slowikowski wrote: On Thursday, 20 February 2014 at 10:35:50 UTC, Stephan Schiffels wrote: Hi Kamil, I am glad someone has the exact same problem as I had. I actually solved this, inspired by the python API you quoted above. I wrote

Re: std.range.chunk without length

2014-02-18 Thread Stephan Schiffels
On Thursday, 13 February 2014 at 17:41:37 UTC, monarch_dodra wrote: On Thursday, 13 February 2014 at 14:45:44 UTC, bearophile wrote: Stephan Schiffels: It would be actually easy to implement chunks without the save function, by using an internal buffer, which would however make

Re: std.range.chunk without length

2014-02-13 Thread Stephan Schiffels
On Thursday, 31 October 2013 at 10:35:54 UTC, Stephan Schiffels wrote: On Wednesday, 30 October 2013 at 20:43:54 UTC, qznc wrote: On Wednesday, 30 October 2013 at 00:20:12 UTC, Stephan Schiffels wrote: Hi, I'd like a version of std.range.chunk that does not require the range to have

Re: std.range.chunk without length

2013-10-31 Thread Stephan Schiffels
On Wednesday, 30 October 2013 at 20:43:54 UTC, qznc wrote: On Wednesday, 30 October 2013 at 00:20:12 UTC, Stephan Schiffels wrote: Hi, I'd like a version of std.range.chunk that does not require the range to have the length property. As an example, consider a file that you would like parse

std.range.chunk without length

2013-10-29 Thread Stephan Schiffels
Hi, I'd like a version of std.range.chunk that does not require the range to have the length property. As an example, consider a file that you would like parse by lines and always lump together four lines, i.e. import std.stdio; void main() { auto range = File(test.txt, r).byLine();

Re: Why I chose D over Ada and Eiffel

2013-08-25 Thread Stephan Schiffels
Nice! I cannot anymore go through all the over 100 replies to this, sorry if someone else has suggested this: You should write this article (tidied up a bit) in a blog or somewhere more public on the web! Here in this forum, things are not as public as they could be! But thanks for sharing

this() immutable

2013-06-13 Thread Stephan Schiffels
Hi, I have some problems with adopting my code to a breaking change introduced in version 2.063. Apparently, now it's not anymore possible to instantiate an immutable object via: auto object = new immutable(SomeClass)(contructor_args...); without also defining either

Re: this() immutable

2013-06-13 Thread Stephan Schiffels
On Thursday, 13 June 2013 at 12:29:57 UTC, Simen Kjaeraas wrote: On Thu, 13 Jun 2013 14:17:22 +0200, Stephan Schiffels stephan_schiff...@mac.com wrote: For example, is there a way of instantiating an object normally (i.e. mutable), and then later freeze it to immutable via a simple cast

Re: builtin sort

2013-06-10 Thread Stephan Schiffels
On Saturday, 8 June 2013 at 22:51:06 UTC, bearophile wrote: Peter Williams: Rather than deprecate it why not fix it? Shouldn't have to import std.algorithm just to sort an array. Generally you want to keep the compiler (all its layers) as simpler as possible, to make it simpler to compile,

Re: builtin sort

2013-06-10 Thread Stephan Schiffels
On Monday, 10 June 2013 at 11:10:06 UTC, Jacob Carlborg wrote: On 2013-06-10 11:03, Stephan Schiffels wrote: I agree. Do people have the same opinion on the builtin reverse? I don't remember whether there was a discussion about this. I suggest to kill that as well. sort and reverse

builtin sort

2013-06-08 Thread Stephan Schiffels
Hi, I know it has been discussed previously to deprecate the builtin sort. I don't know the status of this, but I observed the following problem. With dmd, druntime and phobos all on 2.063, this program runs successfully on a mac: #!/usr/bin/env rdmd import std.stdio; void main() {

Re: builtin sort

2013-06-08 Thread Stephan Schiffels
On Saturday, 8 June 2013 at 08:52:22 UTC, Jonathan M Davis wrote: Hmm, it works just fine on my system (64-bit Linux), so I don't know why you're seeing the problem that you're seeing. Hmm, that's bizarre, but I guess there's no need to understand this further since things work fine with

Re: builtin sort

2013-06-08 Thread Stephan Schiffels
On Saturday, 8 June 2013 at 09:16:23 UTC, monarch_dodra wrote: On Saturday, 8 June 2013 at 08:52:22 UTC, Jonathan M Davis wrote: However, we really, really need to deprecate the built-in sort - especially when a pair of parens can make the difference between whether you call the built-in sort

Re: What happened to next DConf 2013 talk: Shared libraries in D by Martin Nowak?

2013-05-29 Thread Stephan Schiffels
On Wednesday, 29 May 2013 at 15:33:36 UTC, Ettienne Gilbert wrote: BTW, thanks for all the hard work in getting it all out! Rgds +1

Re: any and all not in the doc-index

2013-05-29 Thread Stephan Schiffels
On Tuesday, 28 May 2013 at 22:31:13 UTC, Andrei Alexandrescu wrote: On 5/28/13 6:19 PM, Stephan Schiffels wrote: Hi, is there a reason why any and all from std.algorithm are neither linked in the function index nor in the cheat sheet list at the top of std.algorithm's documentation page? I

any and all not in the doc-index

2013-05-28 Thread Stephan Schiffels
Hi, is there a reason why any and all from std.algorithm are neither linked in the function index nor in the cheat sheet list at the top of std.algorithm's documentation page? I am happy to change this and make a pull request, just weren't sure whether it's on purpose. Stephan

open a range of files - segfault

2013-05-22 Thread Stephan Schiffels
Hi, this code crashes with a segfault. I need help to understand what might be wrong with it. import std.array; import std.algorithm; void main() { auto names = [file1.txt, file2.txt, file3.txt]; // let these files exist auto files = names.map!(f = File(f, r))().array(); } Thanks,

Re: open a range of files - segfault

2013-05-22 Thread Stephan Schiffels
On Wednesday, 22 May 2013 at 11:09:49 UTC, John Colvin wrote: On Wednesday, 22 May 2013 at 11:07:39 UTC, bearophile wrote: Stephan Schiffels: this code crashes with a segfault. I need help to understand what might be wrong with it. import std.array; import std.algorithm; void main() { auto

Range for files by character

2013-05-20 Thread Stephan Schiffels
Hi, I need an Input Range that iterates a file character by character. In bioinformatics this is often important, and having a D-range is of course preferable than any foreach-byLine combination, since we can apply filters and other goodies from std.algorithm. In this implementation, I am

Re: Range for files by character

2013-05-20 Thread Stephan Schiffels
On Monday, 20 May 2013 at 21:40:51 UTC, w0rp wrote: On Monday, 20 May 2013 at 21:36:41 UTC, Stephan Schiffels wrote: Hi, I need an Input Range that iterates a file character by character. In bioinformatics this is often important, and having a D-range is of course preferable than any

Are people using textmate for D programming?

2013-05-18 Thread Stephan Schiffels
Hi everyone, I would like to get an idea how many people are using Textmate as editor in Mac OS X. I am keen to improve the current bundle. Especially the syntax highlighting seems to be stuck somewhere in D1 or so... also, it'd be great to have some command to run unittests and

Re: Are people using textmate for D programming?

2013-05-18 Thread Stephan Schiffels
: On 2013-05-18 13:41, Stephan Schiffels wrote: Hi everyone, I would like to get an idea how many people are using Textmate as editor in Mac OS X. I am keen to improve the current bundle. Especially the syntax highlighting seems to be stuck somewhere in D1 or so... also, it'd be great to have

Re: Are people using textmate for D programming?

2013-05-18 Thread Stephan Schiffels
On Saturday, 18 May 2013 at 16:16:50 UTC, TommiT wrote: On Saturday, 18 May 2013 at 11:41:22 UTC, Stephan Schiffels wrote: Hi everyone, I would like to get an idea how many people are using Textmate as editor in Mac OS X. I am keen to improve the current bundle. Especially the syntax

dlang/tools compilation failed?

2013-03-14 Thread Stephan Schiffels
Hi, is it just me or does changed.d need to be fixed? I get these compiler errors (I use dmd, druntime and phobos from github and up to date). $ make MODEL=64 -f posix.mak dmd -m64 rdmd.d dmd -m64 ddemangle.d dmd -m64 catdoc.d dmd -m64 detab.d dmd -m64 tolf.d dmd -c changed.d

Re: dlang/tools compilation failed?

2013-03-14 Thread Stephan Schiffels
:06:47 Stephan Schiffels wrote: Hi, is it just me or does changed.d need to be fixed? I get these compiler errors (I use dmd, druntime and phobos from github and up to date). $ make MODEL=64 -f posix.mak dmd -m64 rdmd.d dmd -m64 ddemangle.d dmd -m64 catdoc.d dmd -m64 detab.d dmd -m64 tolf.d

joiner and map, strange behavior

2013-03-12 Thread Stephan Schiffels
Hi, I am struggling with understanding this behavior. In the code below, the function getVec is called 8 times, but it should be called only 4 times (once for each call inside of map). Any explanations? Stephan import std.stdio; import std.algorithm; import std.array; int[] getVec(size_t

Re: joiner and map, strange behavior

2013-03-12 Thread Stephan Schiffels
On Tuesday, 12 March 2013 at 17:43:43 UTC, bearophile wrote: Stephan Schiffels: I am struggling with understanding this behavior. In the code below, the function getVec is called 8 times, but it should be called only 4 times (once for each call inside of map). Any explanations? Maybe it's

Re: joiner and map, strange behavior

2013-03-12 Thread Stephan Schiffels
Am 12.03.13 20:22, schrieb Timon Gehr: On 03/12/2013 06:51 PM, Stephan Schiffels wrote: ... Thanks, I had a brief look at std.algorithm.joiner but couldn't find anything obvious, maybe I should look deeper into it. ... I guess it is because of the following: Eg (similar code occurs two

Re: Best way to handle settings files (ini file syntax or similar)

2013-02-28 Thread Stephan Schiffels
Am 27.02.13 21:36, schrieb Dicebot: For anything even remotely complex I would have probably chosen JSON, either new std.json pending for review (not current std.json!) or vibe.data.json from vibed.org project. Which std.json are you referring to? There is no std.json2 or something in the