Menu

#69 Improve performance in TokenMarker.handleRule()

closed-fixed
6
2007-02-21
2007-02-19
No

"""String(checkRule.upHashChars)""" seems to be very expensive at the beginning of checkRule().

The attached patch avoids this.

I've found this bottleneck, which made jEdit really sloppy here in the last days, by using jProfiler.
I'm not sure if there are any side effects, but it results in better performance!

The if-statement above the patched one should get optimized probably, too.

Assigning to vampire, because he refactored this part before.

Discussion

  • daniel hahler

    daniel hahler - 2007-02-19

    Patch against trunk (r8990)

     
  • Marcelo Vanzin

    Marcelo Vanzin - 2007-02-20

    Logged In: YES
    user_id=75113
    Originator: NO

    I have a better fix for that in my tree (sort rule.upHashChars in the rule's constructor; use Arrays.binarySearch later), but I think something even better here would be not to create a new String for the other case (when using upHashChar), since it's used more often. That didn't show up in jProfiler? I'll create something for that case also.

     
  • Marcelo Vanzin

    Marcelo Vanzin - 2007-02-21
    • status: open --> closed-fixed
     
  • Marcelo Vanzin

    Marcelo Vanzin - 2007-02-21

    Logged In: YES
    user_id=75113
    Originator: NO

    I committed a different change to SVN (#9003). Thanks for checking this out!

     

Log in to post a comment.