[#8815] Segfault in libc strlen, via rb_str_new2 — "Sean E. Russell" <ser@...>

Howdy,

12 messages 2006/09/09
[#8817] Re: Segfault in libc strlen, via rb_str_new2 — Eric Hodel <drbrain@...7.net> 2006/09/09

On Sep 8, 2006, at 10:10 PM, Sean E. Russell wrote:

Re: Segfault in libc strlen, via rb_str_new2

From: Sean Russell <ser@...>
Date: 2006-09-11 16:00:53 UTC
List: ruby-core #8840
On Sunday 10 September 2006 16:57, Eric Hodel wrote:
> > Hmm.  My C is rusty, but I didn't think there was any difference
> > between a
> > pointer and an integer on 32-bit x86.
>
> I don't have one of those (PPC G4).  It is very likely that you'll
> run into a platform where this will matter, so your code should be
> correct.

Sure, but nobody is ever going to see this.  I was doing some hacking to 
check performance; not writing something for distribution.

In case anybody on the list is interested, I was testing using DL to 
dynamically change REXML's core parser to libxml2, in the hopes of 
speeding things up.  It turns out that using libxml2 to do pull parsing 
is slower than doing it in Ruby, with regexps.  I suspect that this has 
to do with the overhead of calling native functions and returning Ruby 
objects as results.  Pull parsing makes one call per pull, so the 
overhead becomes significant.

The end result is that REXML is stuck with pure-Ruby parsing for the 
moment.  I can easily believe that Ruby will gain improved performance 
through JIT before the performance of native library calls is improved.

--- SER

In This Thread