Menu

#177 performance tuning for selector LIKE

v3.0 Rabbit Hole
closed-accepted
JBossMQ (39)
5
2002-04-04
2002-03-18
Loren Rosen
No

It was taking about 60 ms to scan a 1000
messages with a selector containing a
regular expression (with JDK 1.3.1...
it was far worse with earlier JVMs).

It turns out the code was recompiling
the RE on every message tested. In
addition to adding time overhead this
probably produces lots of garbage.

The patch changes the Operator class
to retain the results of the RE compilation
done the first time the selector is
evaluated. (It might be more logical
to compile the RE when the selector
is parsed, but that change would be
a bit more complicated to make).

The RE wrapper code (which wraps the
gnu regexp code) was moved into a
separate class for clarity.

Some other small changes were
made to improve performance
and clarity.

End result is a 2X speed-up
(from 60ms/1000msg to 30/1000)

Discussion

  • Loren Rosen

    Loren Rosen - 2002-03-18

    tar file relative to jboss-all directory

     
  • Jason Dillon

    Jason Dillon - 2002-04-04

    Logged In: YES
    user_id=15045

    Sounds reasonable. Looked over the patch and ran
    testsuite and all looks ok. Perhaps you can also provide
    a stress/perf test for this?

    --jason

     
  • Jason Dillon

    Jason Dillon - 2002-04-04
    • assigned_to: nobody --> user57
    • status: open --> closed-accepted
     

Log in to post a comment.

MongoDB Logo MongoDB