[MacRuby-devel] Globbed method arguments (splat) Limit
Laurent Sansonetti
lsansonetti at apple.com
Sat Sep 5 12:34:52 PDT 2009
Hi,
On Sep 5, 2009, at 3:11 AM, John-Paul Bader wrote:
> Hey guys,
>
>
> a friend of mine implemented a heap in ruby for educational
> purposes. He did so with several implementations. He had a few
> benchmarks and I suggested to run them on macruby to see how well it
> would hold up.
>
> Unfortunately we didn't get really far because apparently there is a
> problem with globbed/splatted method arguments in macruby which
> raises an exception if more than 199 arguments are passed.
>
> Can be tested easily with:
>
> def foo(*bar); puts bar.length;end
> 1.upto(1000) {|x| foo(*([0]*x))}
>
> In vm.cpp:2977 #define MAX_DISPATCH_ARGS 200 is defined and a big
> fat todo is right below it addressing this issue. Now I know its not
> a super urgent problem because its not what you do in ruby every
> day. Still its obviously something that has to change.
>
> In line 3003 there is this assert: assert(real_argc + count <
> MAX_DISPATCH_ARGS); so it must be important i guess.
>
> So i'm just wondering why it is limited to 200 in the first place
> and if there is something I can to even though I'm not really a
> capable (objective) c programmer ?
This limitation is purely temporary and is because of a limitation in
the dispatcher. This will be addressed for the release.
> After commenting out the code with the globbed arguments the
> benchmarks on the remaining tests ran a bit slower than on ruby 1.9.1.
Can you share these benchmarks? I would be very interested to see the
results and also if we can be better.
Laurent
More information about the MacRuby-devel
mailing list