On Tuesday, 22 December 2015 at 19:50:28 UTC, Daniel Kozák wrote:
V Tue, 22 Dec 2015 18:39:16 +
Ivan Kazmenko via Digitalmars-d-learn
napsáno:
Does DMD, or Phobos function to!(string), do anything like
that? The number of possible bases is not large
On Tuesday, 22 December 2015 at 17:23:11 UTC, Andrew Chapman
wrote:
On Tuesday, 22 December 2015 at 17:18:16 UTC, cym13 wrote:
On Tuesday, 22 December 2015 at 17:15:27 UTC, Andrew Chapman
wrote:
Sorry if this is a silly question but is the to! method from
the conv library the most efficient
On Wednesday, 23 December 2015 at 11:21:32 UTC, Jakob Ovrum wrote:
Dynamic memory allocation is expensive. If the string is
short-lived, allocate it on the stack:
See also std.conv.toChars[1] for stringifying lazily/on-demand.
http://dlang.org/phobos/std_conv#toChars
On 12/23/2015 02:29 PM, Andrew Chapman wrote:
> string v = toChars!(16,char,LetterCase.lower)(i);
>
> to convert an integer to Hex for example, but the compiler wasn't happy
> with it. How would I convert an int to a string using this?
I had to squint at the error message to understand that
On Wednesday, 23 December 2015 at 11:46:37 UTC, Jakob Ovrum wrote:
On Wednesday, 23 December 2015 at 11:21:32 UTC, Jakob Ovrum
wrote:
Dynamic memory allocation is expensive. If the string is
short-lived, allocate it on the stack:
See also std.conv.toChars[1] for stringifying lazily/on-demand.
On Wednesday, 23 December 2015 at 22:29:31 UTC, Andrew Chapman
wrote:
On Wednesday, 23 December 2015 at 11:46:37 UTC, Jakob Ovrum
wrote:
On Wednesday, 23 December 2015 at 11:21:32 UTC, Jakob Ovrum
wrote:
Dynamic memory allocation is expensive. If the string is
short-lived, allocate it on the
V Tue, 22 Dec 2015 18:39:16 +
Ivan Kazmenko via Digitalmars-d-learn
napsáno:
> On Tuesday, 22 December 2015 at 18:11:24 UTC, rumbu wrote:
> > On Tuesday, 22 December 2015 at 17:15:27 UTC, Andrew Chapman
> > wrote:
> >> Sorry if this is a silly question
V Tue, 22 Dec 2015 18:11:24 +
rumbu via Digitalmars-d-learn
napsáno:
> On Tuesday, 22 December 2015 at 17:15:27 UTC, Andrew Chapman
> wrote:
> > Sorry if this is a silly question but is the to! method from
> > the conv library the most efficient way of
On Tuesday, 22 December 2015 at 17:15:27 UTC, Andrew Chapman
wrote:
Sorry if this is a silly question but is the to! method from
the conv library the most efficient way of converting an
integer value to a string?
e.g.
string s = to!string(100);
I'm seeing a pretty dramatic slow down in my
V Tue, 22 Dec 2015 17:15:27 +
Andrew Chapman via Digitalmars-d-learn
napsáno:
> Sorry if this is a silly question but is the to! method from the
> conv library the most efficient way of converting an integer
> value to a string?
>
> e.g.
> string s =
V Tue, 22 Dec 2015 20:52:07 +
rumbu via Digitalmars-d-learn
napsáno:
> On Tuesday, 22 December 2015 at 19:45:46 UTC, Daniel Kozák wrote:
> > V Tue, 22 Dec 2015 18:11:24 +
> > rumbu via Digitalmars-d-learn
> >
> >
On Tuesday, 22 December 2015 at 18:11:24 UTC, rumbu wrote:
On Tuesday, 22 December 2015 at 17:15:27 UTC, Andrew Chapman
wrote:
Sorry if this is a silly question but is the to! method from
the conv library the most efficient way of converting an
integer value to a string?
e.g.
string s =
On Tuesday, 22 December 2015 at 20:52:07 UTC, rumbu wrote:
On Tuesday, 22 December 2015 at 19:45:46 UTC, Daniel Kozák
wrote:
V Tue, 22 Dec 2015 18:11:24 +
rumbu via Digitalmars-d-learn
napsáno:
On Tuesday, 22 December 2015 at 17:15:27 UTC, Andrew
On Tue, Dec 22, 2015 at 08:54:35PM +0100, Daniel Kozák via Digitalmars-d-learn
wrote:
> V Tue, 22 Dec 2015 09:43:00 -0800
> "H. S. Teoh via Digitalmars-d-learn"
> napsáno:
>
> > On Tue, Dec 22, 2015 at 05:23:11PM +, Andrew Chapman via
> >
V Tue, 22 Dec 2015 21:10:54 +
rumbu via Digitalmars-d-learn
napsáno:
> On Tuesday, 22 December 2015 at 20:52:07 UTC, rumbu wrote:
> > On Tuesday, 22 December 2015 at 19:45:46 UTC, Daniel Kozák
> > wrote:
> >> V Tue, 22 Dec 2015 18:11:24 +
> >> rumbu
On 12/22/15 12:15 PM, Andrew Chapman wrote:
Sorry if this is a silly question but is the to! method from the conv
library the most efficient way of converting an integer value to a string?
e.g.
string s = to!string(100);
I'm seeing a pretty dramatic slow down in my code when I use a
conversion
On Tuesday, 22 December 2015 at 18:27:12 UTC, cym13 wrote:
...
I don't think there is anything in the standard
library that would really help here as (if I read it correctly)
it is mainly
because of the conversion from ranges to arrays that this code
is slow.
Yes, it has been faster in past,
On 12/22/2015 10:15 AM, Andrew Chapman wrote:
> On Tuesday, 22 December 2015 at 18:11:24 UTC, rumbu wrote:
>> Converting numbers to string involves the most expensive known two
>> operations : division and modulus by 10.
>
> Cool thanks, so essentially it's unavoidable
There is hope. :)
> I
On Tuesday, 22 December 2015 at 18:11:24 UTC, rumbu wrote:
On Tuesday, 22 December 2015 at 17:15:27 UTC, Andrew Chapman
wrote:
Sorry if this is a silly question but is the to! method from
the conv library the most efficient way of converting an
integer value to a string?
e.g.
string s =
V Tue, 22 Dec 2015 09:43:00 -0800
"H. S. Teoh via Digitalmars-d-learn"
napsáno:
> On Tue, Dec 22, 2015 at 05:23:11PM +, Andrew Chapman via
> Digitalmars-d-learn wrote: [...]
> > for({int i; i = 0;} i < num; i++) {
> > //string s =
On Tuesday, 22 December 2015 at 17:43:00 UTC, H. S. Teoh wrote:
I wonder if the slowdown is caused by GC collection cycles
(because calling to!string will allocate, and here you're
making a very large number of small allocations, which is known
to cause GC performance issues).
Try inserting
V Tue, 22 Dec 2015 12:55:10 -0800
"H. S. Teoh via Digitalmars-d-learn"
napsáno:
> On Tue, Dec 22, 2015 at 08:54:35PM +0100, Daniel Kozák via
> Digitalmars-d-learn wrote:
> > V Tue, 22 Dec 2015 09:43:00 -0800
> > "H. S. Teoh via Digitalmars-d-learn"
> >
On Tuesday, 22 December 2015 at 17:15:27 UTC, Andrew Chapman
wrote:
Sorry if this is a silly question but is the to! method from
the conv library the most efficient way of converting an
integer value to a string?
e.g.
string s = to!string(100);
I'm seeing a pretty dramatic slow down in my
On Tue, Dec 22, 2015 at 05:23:11PM +, Andrew Chapman via
Digitalmars-d-learn wrote:
[...]
> for({int i; i = 0;} i < num; i++) {
> //string s = to!string(i);
> Customer c = Customer(i, "Customer", "", i * 2);
> string result =
On Tuesday, 22 December 2015 at 17:18:16 UTC, cym13 wrote:
On Tuesday, 22 December 2015 at 17:15:27 UTC, Andrew Chapman
wrote:
Sorry if this is a silly question but is the to! method from
the conv library the most efficient way of converting an
integer value to a string?
e.g.
string s =
On Tuesday, 22 December 2015 at 17:52:52 UTC, Andrew Chapman
wrote:
On Tuesday, 22 December 2015 at 17:43:00 UTC, H. S. Teoh wrote:
I wonder if the slowdown is caused by GC collection cycles
(because calling to!string will allocate, and here you're
making a very large number of small
On Tuesday, 22 December 2015 at 19:45:46 UTC, Daniel Kozák wrote:
V Tue, 22 Dec 2015 18:11:24 +
rumbu via Digitalmars-d-learn
napsáno:
On Tuesday, 22 December 2015 at 17:15:27 UTC, Andrew Chapman
wrote:
> Sorry if this is a silly question but is the
27 matches
Mail list logo