[#4654] signleton_methods / methods / public_methods - weirdness? — Johan Holmberg <holmberg@...>
[#4666] Getting a hex representation for a Numeric — "Zev Blut" <rubyzbibd@...>
Hello,
[#4670] ruby 1.8.3 preview1 plan — Yukihiro Matsumoto <matz@...>
Hi,
[#4690] test failures for stable-snapshot 09/04/2005 — noreply@...
Bugs item #1762, was opened at 10-04-2005 20:46
Hello.
[#4709] BNF-like grammar specified DIRECTLY in Ruby — Eric Mahurin <eric_mahurin@...>
Hello everybody,
[#4712] Segfault in zlib? — Nathaniel Talbott <ntalbott@...>
I'm using rubyzip (latest gem version) and zlib (1.2.2) to do a bunch
[#4736] Trivial speedup in Array#zip — Mauricio Fern疣dez <batsman.geo@...>
[#4745] Win32: Ruby & APR; build problems for Ruby Subversion SWIG bindings — Erik Huelsmann <ehuels@...>
Having taken upon me the task to provide a Windows build for
On 4/20/05, Erik Huelsmann <ehuels@gmail.com> wrote:
Hi Austin,
Hi,
On 4/24/05, nobu.nokada@softhome.net <nobu.nokada@softhome.net> wrote:
Hi,
> > > Ruby is just using AC_TYPE_UID_T. So, using typedef for them,
Hi,
On 4/26/05, nobu.nokada@softhome.net <nobu.nokada@softhome.net> wrote:
As promised, I attached a patch to eliminate the compile problems
Hi,
Thanks for the quick response!
Hi,
On 5/14/05, nobu.nokada@softhome.net <nobu.nokada@softhome.net> wrote:
[#4751] Illegal regexp causes segfault — Andrew Walrond <andrew@...>
irb(main):058:0> a = /\[([^]]*)\]/
Andrew Walrond, April 22:
In article <200504221210.38231.andrew@walrond.org>,
>>>>> "T" == Tanaka Akira <akr@m17n.org> writes:
[#4774] enhanced $0 modification — Evan Webb <evanwebb@...>
The attached patch allows for ruby to use more of the available stack
Hi,
[#4775] profiler.rb Schroedinbug — C Erler <erlercw@...>
A ruby program with the single instruction "require 'profile'"
>A ruby program with the single instruction "require 'profile'"
[#4807] Re: -Wall — Vincent Isambart <vincent.isambart@...>
> Why does ruby build without -Wall in CFLAGS by default? -Wall can help to
[#4815] Re: -Wall — nobu.nokada@...
Hi,
[PATCH] Trivial speedup in Array#zip
Silly benchmark:
(2..7).each do |i|
a = [10] * 10**i
b = [20] * 10**i
t = Time.new
a.zip(b){|x,y|}
puts "%9d: %8.5f" % [10**i, Time.new - t]
end
(you might also want to try a.zip(b){||} )
Results:
patched
batsman@tux-chan:/tmp/ruby$ ./ruby /tmp/bench.rb
100: 0.00007
1000: 0.00051
10000: 0.00496
100000: 0.06115
1000000: 0.48373
10000000: 4.71240
orig -> ruby 1.8.2 (2005-04-12) [i686-linux]
batsman@tux-chan:/tmp/ruby$ ruby /tmp/bench.rb
100: 0.00010
1000: 0.00077
10000: 0.00941
100000: 0.15001
1000000: 4.45847
10000000: 358.12643
Note that the difference would be larger if the environment were a bit
"heavier" (more live objects). Of course, it will be less important
for most realistic usages of #zip with non-empty blocks, but it's
nonetheless an overhead there's no reason to keep AFAIK.
Once the patch is applied, the temporary array used to hold the items
from the original arrays is allocated once; in the original code, it
would be discarded on each iteration and a new one would be allocated,
often triggering the GC...
--- array.c.orig 2005-04-18 00:11:33.000000000 +0200
+++ array.c 2005-04-18 00:22:18.000000000 +0200
@@ -2074,12 +2074,12 @@
argv[i] = to_ary(argv[i]);
}
if (rb_block_given_p()) {
+ VALUE tmp = rb_ary_new2(argc+1);
+ RARRAY(tmp)->len = argc + 1;
for (i=0; i<RARRAY(ary)->len; i++) {
- VALUE tmp = rb_ary_new2(argc+1);
-
- rb_ary_push(tmp, rb_ary_elt(ary, i));
+ RARRAY(tmp)->ptr[0] = RARRAY(ary)->ptr[i];
for (j=0; j<argc; j++) {
- rb_ary_push(tmp, rb_ary_elt(argv[j], i));
+ RARRAY(tmp)->ptr[1+j] = rb_ary_elt(argv[j], i);
}
rb_yield(tmp);
}
--
Mauricio Fern疣dez