I’ve been playing around with lexers that rely on the Ruby StringScanner
to recognize lexical tokens. For large texts, the lexers are roughly
twice as slow in JRuby as in MRI. I haven’t probed any further, but am
wondering if there are known performance issues in this area. It looks
like both MRI and JRuby have “native” implementations of StringScanner.
Yes, you’re right. On closer inspection, the JRuby StringScanner is
out-performing the MRI scanner; it’s the additional string processing
that I have around the scanner that is resulting in a much slower run
with JRuby. I’ll have to narrow this down.
// Gregory
Vladimir S. wrote:
provide a simplified benchmark that shows the problem.
JRuby have “native” implementations of StringScanner.
On the whole, my application is slower with JRuby 1.2. But when I
micro-benchmark each stage individually, the benchmarks show that JRuby
is faster. I think I need to look more closely at what the JVM is doing
when the application as a whole is running, this may in fact be a
resource issue.
// Gregory
Marcin Mielżyński wrote:
Vladimir S. wrote:
provide a simplified benchmark that shows the problem.