[ragel-users] Improving perf of the Java code

Conrad Steenberg conrad.steenberg at gmail.com
Wed Dec 21 19:04:55 UTC 2011


My only experience is in porting the non-goto (-F0) ruby emitter, but in
general I think if you know the target language it's actually quite easy
to write a new emitter.

In your case I think it will probably be easier to go that route than
Ragel-> C-> bytecode.

Conrad

On Wed, 2011-12-21 at 12:52 -0600, Charles Oliver Nutter wrote:
> Yeah, that's kinda what I was thinking. Specifically, my own JVM
> language that's a thin layer over JVM bytecode:
> 
> https://github.com/headius/bitescript/blob/master/examples/fib.bs
> 
> The other though I had was emitting normal Java code that could be
> post-processed into a goto...i.e. emit calls like
> 
> _label("named label")
> 
> _goto("named label")
> 
> And post-process the bytecode to use JVM bytecode goto instead.
> 
> If we were able to emit something like that, how hard would it be to
> get the faster FSM forms ported to Java?
> 
> - Charlie
> 
> On Wed, Dec 21, 2011 at 11:02 AM, Conrad Steenberg
> <conrad.steenberg at gmail.com> wrote:
> > Hi Charlie,
> >
> > I addition to looking at a bytecode generator, you might also look at
> > generating code for another JVM language that does have support for
> > goto. That language might even be C, if you can get the resulting code
> > to generate the JRuby objects you need.
> >
> > See http://en.wikipedia.org/wiki/List_of_JVM_languages
> >
> > On Wed, 2011-12-21 at 00:30 -0600, Charles Oliver Nutter wrote:
> >> Hello!
> >>
> >> I work on JRuby, the Ruby implementation for the JVM. As you may know,
> >> Ruby users have latched on to Ragel for a number of parser tasks, such
> >> as json, http, various markup languages, and so on.
> >>
> >> I have spent the last day trying to optimize a Ragel-generated json
> >> parser used as an extension to JRuby, and despite my best efforts I
> >> can't get it more than about 2x slower than the version for C Ruby.
> >> This is especially poor considering the Ruby code that surrounds it
> >> should run significantly faster on JRuby, and it still doesn't make up
> >> the gap.
> >>
> >> I'm wondering what, if anything, can be done to improve the
> >> performance of the generated Java code. I notice that Java is only
> >> supported in the simplest output form, presumably because of the lack
> >> of "goto". I'm interested in exploring options to bring the Java code
> >> up to par with the generated code for other languages, perhaps by
> >> implementing it using raw JVM bytecode (using some assembly-like
> >> format like BiteScript or Jasmin) or by post-processing the compiled
> >> result to insert true gotos.
> >>
> >> Any pointers on this? Any prior work or tips?
> >>
> >> - Charlie
> >>
> >> _______________________________________________
> >> ragel-users mailing list
> >> ragel-users at complang.org
> >> http://www.complang.org/mailman/listinfo/ragel-users
> >
> >
> > _______________________________________________
> > ragel-users mailing list
> > ragel-users at complang.org
> > http://www.complang.org/mailman/listinfo/ragel-users

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part
URL: <http://www.colm.net/pipermail/ragel-users/attachments/20111221/644e38af/attachment-0001.sig>
-------------- next part --------------
_______________________________________________
ragel-users mailing list
ragel-users at complang.org
http://www.complang.org/mailman/listinfo/ragel-users


More information about the ragel-users mailing list