Re: [Rosettacode] Growable slices

2014-05-16 Thread bearophile via Digitalmars-d-learn
There are of course ways to implement a really efficient ZLW compressor in D, and such implementation could be added as third D entry if it manages to be not too much long, Third version added: http://rosettacode.org/wiki/LZW_compression#More_Efficient_Version I have tried to make it

Re: [Rosettacode] Growable slices

2014-05-16 Thread Artur Skawina via Digitalmars-d-learn
On 05/16/14 11:47, bearophile via Digitalmars-d-learn wrote: There are of course ways to implement a really efficient ZLW compressor in D, and such implementation could be added as third D entry if it manages to be not too much long, Third version added:

Re: [Rosettacode] Growable slices

2014-05-16 Thread bearophile via Digitalmars-d-learn
Artur Skawina: So how does it perform wrt the D version that I wrote for you last time? [1] [1] http://forum.dlang.org/post/mailman.2132.1353592965.5162.digitalmar...@puremagic.com) From your answer: First, the code above is practically a textbook example on how /not/ to write readable and

Re: [Rosettacode] Growable slices

2014-05-16 Thread bearophile via Digitalmars-d-learn
Artur Skawina: Ugh. So how does it perform wrt the D version that I wrote for you last time? [1] I have done a benchmark with the various version (the first 3 are the ones on the Rosettacode site, and the #4 is yours): lzw1: 0.39 lzw2: 0.17 lzw3: 0.21 lzw4: 0.17 I think your comment was

Re: [Rosettacode] Growable slices

2014-05-16 Thread monarch_dodra via Digitalmars-d-learn
On Friday, 16 May 2014 at 15:20:04 UTC, bearophile wrote: Artur Skawina: Ugh. So how does it perform wrt the D version that I wrote for you last time? [1] I have done a benchmark with the various version (the first 3 are the ones on the Rosettacode site, and the #4 is yours): lzw1: 0.39

Re: [Rosettacode] Growable slices

2014-05-16 Thread bearophile via Digitalmars-d-learn
monarch_dodra: Arguably, your code allocates a lot. What version (1-2-3) do you mean? I'll give it a shot (next week). I think the LZW entries are OK :) So if you want to work on Rosettacode it's better to write an entry that is missing in D. Bye, bearophile

Re: [Rosettacode] Growable slices

2014-05-16 Thread Artur Skawina via Digitalmars-d-learn
On 05/16/14 17:20, bearophile via Digitalmars-d-learn wrote: Artur Skawina: Ugh. So how does it perform wrt the D version that I wrote for you last time? [1] I have done a benchmark with the various version (the first 3 are the ones on the Rosettacode site, and the #4 is yours): lzw1:

Re: [Rosettacode] Growable slices

2014-05-16 Thread monarch_dodra via Digitalmars-d-learn
On Friday, 16 May 2014 at 15:49:10 UTC, bearophile wrote: monarch_dodra: Arguably, your code allocates a lot. What version (1-2-3) do you mean? Any of the versions where you can see [c] or [b] where c/b is a char/byte

[Rosettacode] Growable slices

2014-05-15 Thread bearophile via Digitalmars-d-learn
This task asks for an basic implementation of the the Lempel-Ziv-Welch (LZW) compression/decompression algorithm. I am keeping two D versions, the first one is minimal, and the second is a little more optimized: http://rosettacode.org/wiki/LZW_compression#More_Refined_Version There are of

Re: [Rosettacode] Growable slices

2014-05-15 Thread monarch_dodra via Digitalmars-d-learn
On Thursday, 15 May 2014 at 09:00:13 UTC, bearophile wrote: This task asks for an basic implementation of the the Lempel-Ziv-Welch (LZW) compression/decompression algorithm. I am keeping two D versions, the first one is minimal, and the second is a little more optimized: