Re: Memory allocation faile on string concat

2010-12-23 Thread Steven Schveighoffer
On Thu, 11 Nov 2010 07:42:36 -0500, Steven Schveighoffer wrote: On Wed, 10 Nov 2010 23:33:58 -0500, Xie wrote: OK, this actually makes sense to me. It's a manifestation of this issue: http://d.puremagic.com/issues/show_bug.cgi?id=3929 I'm think - it's truth but not at all. Sorry, but

Re: Memory allocation faile on string concat

2010-11-11 Thread Steven Schveighoffer
On Wed, 10 Nov 2010 23:33:58 -0500, Xie wrote: OK, this actually makes sense to me. It's a manifestation of this issue: http://d.puremagic.com/issues/show_bug.cgi?id=3929 I'm think - it's truth but not at all. Sorry, but i'm give incomplete data. My example run fine, when benchmark(1), (

Re: Memory allocation faile on string concat

2010-11-10 Thread Xie
>OK, this actually makes sense to me. >It's a manifestation of this issue: >http://d.puremagic.com/issues/show_bug.cgi?id=3929 I'm think - it's truth but not at all. Sorry, but i'm give incomplete data. My example run fine, when benchmark(1), (2), but not 10. This means, that memory not collect

Re: Memory allocation faile on string concat

2010-11-10 Thread Steven Schveighoffer
On Wed, 10 Nov 2010 14:38:02 -0500, Xie wrote: Sorry, it a mistypo (i began from wchar[], later changed to wstring) Real problem can be seen here import std.stdio; import std.date; void f0() { wstring a; foreach(i; 0 .. 100_000_000) { a ~= " "w;

Re: Memory allocation faile on string concat

2010-11-10 Thread Xie
Sorry, it a mistypo (i began from wchar[], later changed to wstring) Real problem can be seen here import std.stdio; import std.date; void f0() { wstring a; foreach(i; 0 .. 100_000_000) { a ~= " "w; } } void main() { auto r = benchmark!(f

Re: Memory allocation faile on string concat

2010-11-10 Thread Steven Schveighoffer
On Wed, 10 Nov 2010 14:06:40 -0500, Steven Schveighoffer wrote: Just tried it, Appender is actually slower. This *is* a problem, it should be way faster than builtin array appending. I will look into it. More data, Appender taking an array of elements is significantly slower than taki

Re: Memory allocation faile on string concat

2010-11-10 Thread Steven Schveighoffer
On Wed, 10 Nov 2010 13:55:26 -0500, sybrandy wrote: On 11/10/2010 11:33 AM, Xie wrote: Can't run a simple program. What's wrong, GC? import std.stdio; import std.date; void f0() { wstring a[]; foreach(i; 0 .. 100_000_000) { a ~= " "w; } } voi

Re: Memory allocation faile on string concat

2010-11-10 Thread sybrandy
On 11/10/2010 11:33 AM, Xie wrote: Can't run a simple program. What's wrong, GC? import std.stdio; import std.date; void f0() { wstring a[]; foreach(i; 0 .. 100_000_000) { a ~= " "w; } } void main() { auto r = benchmark!(f0)(1);

Re: Memory allocation faile on string concat

2010-11-10 Thread Steven Schveighoffer
On Wed, 10 Nov 2010 13:33:11 -0500, Steven Schveighoffer wrote: On Wed, 10 Nov 2010 11:33:45 -0500, Xie wrote: Can't run a simple program. What's wrong, GC? import std.stdio; import std.date; void f0() { wstring a[]; foreach(i; 0 .. 100_000_000) {

Re: Memory allocation faile on string concat

2010-11-10 Thread Steven Schveighoffer
On Wed, 10 Nov 2010 11:33:45 -0500, Xie wrote: Can't run a simple program. What's wrong, GC? import std.stdio; import std.date; void f0() { wstring a[]; foreach(i; 0 .. 100_000_000) { a ~= " "w; } } void main() { auto r = benchmark!(f0

Re: Memory allocation faile on string concat

2010-11-10 Thread Jonathan M Davis
On Wednesday, November 10, 2010 08:33:45 Xie wrote: > Can't run a simple program. What's wrong, GC? > > import std.stdio; > import std.date; > > void f0() > { > wstring a[]; > > foreach(i; 0 .. 100_000_000) > { > a ~= " "w; > } > } > > void main() > { >

Memory allocation faile on string concat

2010-11-10 Thread Xie
Can't run a simple program. What's wrong, GC? import std.stdio; import std.date; void f0() { wstring a[]; foreach(i; 0 .. 100_000_000) { a ~= " "w; } } void main() { auto r = benchmark!(f0)(1); writeln(r, "ms"); } DMD 2.047