Am Sun, 22 Apr 2012 09:23:45 +0200
schrieb Jay Norwood j...@prismnet.com:
On Sunday, 22 April 2012 at 06:26:42 UTC, Jonathan M Davis wrote:
You can look at the code. It checks each of the characters in
place. Unlike
toLower, it doesn't need to generate a new string. But as far
as the
On Mon, 23 Apr 2012 16:43:20 +0100, Steven Schveighoffer
schvei...@yahoo.com wrote:
While dealing with unicode in my std.stream rewrite, I've found that
hand-decoding dchars is way faster than using library calls.
After watching Andrei's talk on generic and generative programming I have
On Tuesday, 24 April 2012 at 11:24:44 UTC, Regan Heath wrote:
On Mon, 23 Apr 2012 16:43:20 +0100, Steven Schveighoffer
schvei...@yahoo.com wrote:
While dealing with unicode in my std.stream rewrite, I've
found that hand-decoding dchars is way faster than using
library calls.
After watching
On Tuesday, 24 April 2012 at 14:54:48 UTC, Steven Schveighoffer
wrote:
On Tuesday, 24 April 2012 at 11:24:44 UTC, Regan Heath wrote:
After watching Andrei's talk on generic and generative
programming I have to ask, which routines are you avoiding ..
it seems we need to make them as good as the
On Tuesday, April 24, 2012 12:24:44 Regan Heath wrote:
On Mon, 23 Apr 2012 16:43:20 +0100, Steven Schveighoffer
schvei...@yahoo.com wrote:
While dealing with unicode in my std.stream rewrite, I've found that
hand-decoding dchars is way faster than using library calls.
After watching
On Sat, 21 Apr 2012 19:24:56 -0400, Jay Norwood j...@prismnet.com wrote:
While playing with sorting the unzip archive entries I tried use of the
last example in http://dlang.org/phobos/std_algorithm.html#sort
std.algorithm.sort!(toLower(a.name)
On Monday, 23 April 2012 at 11:27:40 UTC, Steven Schveighoffer
wrote:
I think using std.string.icmp is the best solution. I would
expect it to outperform even schwartz sort.
-Steve
icmp took longer... added about 1 sec vs 0.3 sec (for
schwartzSort ) to the program execution time.
bool
On Mon, 23 Apr 2012 09:49:50 -0400, Jay Norwood j...@prismnet.com wrote:
On Monday, 23 April 2012 at 11:27:40 UTC, Steven Schveighoffer
wrote:
I think using std.string.icmp is the best solution. I would expect it
to outperform even schwartz sort.
-Steve
icmp took longer... added about 1
On Sunday, 22 April 2012 at 02:29:45 UTC, Jonathan M Davis wrote:
Regardless of whether it's the Big(O) complexity or the
constant factor that's
the problem here, clearly there's enough additional overhead
that it's causing
problems for Jay's particular case. It's also the sort of thing
that
On Sunday, April 22, 2012 08:20:13 Jay Norwood wrote:
The comment below worries me a little bit about std.string.icmp.
What if they are two 1MB strings that differ in he first
character? Does it really convert both strings to lower case
before comparing the first character?
On Sunday, 22 April 2012 at 06:26:42 UTC, Jonathan M Davis wrote:
You can look at the code. It checks each of the characters in
place. Unlike
toLower, it doesn't need to generate a new string. But as far
as the
comparison goes, they're the same - hence that line in the docs.
- Jonathan M
On 22.04.2012 5:43, Ali Çehreli wrote:
On 04/21/2012 04:24 PM, Jay Norwood wrote:
While playing with sorting the unzip archive entries I tried use of the
last example in http://dlang.org/phobos/std_algorithm.html#sort
std.algorithm.sort!(toLower(a.name)
On 2012-04-22 01:24, Jay Norwood wrote:
While playing with sorting the unzip archive entries I tried use of the
last example in http://dlang.org/phobos/std_algorithm.html#sort
std.algorithm.sort!(toLower(a.name)
toLower(b.name),std.algorithm.SwapStrategy.stable)(entries);
It was terribly slow
On Saturday, 21 April 2012 at 23:24:57 UTC, Jay Norwood wrote:
While playing with sorting the unzip archive entries I tried
use of the last example in
http://dlang.org/phobos/std_algorithm.html#sort
std.algorithm.sort!(toLower(a.name)
On Sunday, 22 April 2012 at 00:36:19 UTC, bearophile wrote:
Performing the toLower every time the cmp function is called
doesn't change the O complexity. In Phobos there is an
alternative sorting (Schwartzian sorting routime) that applies
a function to each item before sorting them, usually is
While playing with sorting the unzip archive entries I tried use
of the last example in
http://dlang.org/phobos/std_algorithm.html#sort
std.algorithm.sort!(toLower(a.name)
toLower(b.name),std.algorithm.SwapStrategy.stable)(entries);
It was terribly slow for sorting the 34k entries in my
On Sunday, April 22, 2012 01:24:56 Jay Norwood wrote:
While playing with sorting the unzip archive entries I tried use
of the last example in
http://dlang.org/phobos/std_algorithm.html#sort
std.algorithm.sort!(toLower(a.name)
toLower(b.name),std.algorithm.SwapStrategy.stable)(entries);
On Saturday, April 21, 2012 20:36:18 bearophile wrote:
Jonathan M Davis:
I'm not sure if it's
an order of magnitude worse than your solution though, since it's been a
while since I studied Big(O) notation (doing the conversion only once is
still more expensive than not converting, but I'm
On Sat, Apr 21, 2012 at 05:45:35PM -0700, Jonathan M Davis wrote:
On Saturday, April 21, 2012 20:36:18 bearophile wrote:
Jonathan M Davis:
I'm not sure if it's an order of magnitude worse than your
solution though, since it's been a while since I studied Big(O)
notation (doing the
On 04/21/2012 04:24 PM, Jay Norwood wrote:
While playing with sorting the unzip archive entries I tried use of the
last example in http://dlang.org/phobos/std_algorithm.html#sort
std.algorithm.sort!(toLower(a.name)
toLower(b.name),std.algorithm.SwapStrategy.stable)(entries);
Stealing this
On Saturday, 21 April 2012 at 23:54:26 UTC, Jonathan M Davis
wrote:
Yeah. toLower would be called on both strings on _every_
compare. And since
that involves a loop, that would make the overall call to sort
an order of
magnitude worse than if you didn't call toLower at all. I'm not
sure if
On Sunday, April 22, 2012 03:47:30 Jay Norwood wrote:
On Saturday, 21 April 2012 at 23:54:26 UTC, Jonathan M Davis
wrote:
Yeah. toLower would be called on both strings on _every_
compare. And since
that involves a loop, that would make the overall call to sort
an order of
magnitude
On Saturday, April 21, 2012 18:43:23 Ali Çehreli wrote:
On 04/21/2012 04:24 PM, Jay Norwood wrote:
While playing with sorting the unzip archive entries I tried use of the
last example in http://dlang.org/phobos/std_algorithm.html#sort
std.algorithm.sort!(toLower(a.name)
On Saturday, April 21, 2012 18:26:42 H. S. Teoh wrote:
Actually, I don't think the nested loops affect Big-O complexity at all.
The O(l) complexity (where l = string length) is already inherent in the
string comparison str otherStr. Adding more loops over the strings
doesn't change the Big-O
24 matches
Mail list logo