#433 elasticTabStop - Check attribute not property

closed-accepted
None
5
2012-08-04
2012-06-09
No

The property "elasticTabstops" is at least checked 4 times for each Insert/Replace action done on a JeditBuffer, i.e. the relevant handler is called in ElasticTabStopBufferListener class. As it happens on my machine this property lands in the same bucket in the locally buffered property HashMap as "Buffer__selection" and so each check for property "elasticTabstops" creates two accesses to the HashMap table.
For millions of insert and replace actions this takes as sum several seconds. Optimize this a bit and use field elasticTabstopsOn of the JeditBuffer.

Some numbers for 226.000 replaces/1000 lines:

Without patches:
12:29:10 [AWT-EventQueue-0] [debug] AWT-EventQueue-0: Call= 1 Diff=4128889994 Avg=4128889994
12:29:21 [AWT-EventQueue-0] [debug] AWT-EventQueue-0: Call= 2 Diff=1399870402 Avg=2764380198
12:29:29 [AWT-EventQueue-0] [debug] AWT-EventQueue-0: Call= 3 Diff=638770615 Avg=2055843670

With ElasticTabStopBufferListener patch:
12:26:47 [AWT-EventQueue-0] [debug] AWT-EventQueue-0: Call= 1 Diff=3143171489 Avg=3143171489
12:26:56 [AWT-EventQueue-0] [debug] AWT-EventQueue-0: Call= 2 Diff=782560407 Avg=1962865948
12:27:04 [AWT-EventQueue-0] [debug] AWT-EventQueue-0: Call= 3 Diff=1982167355 Avg=1969299750

Discussion

  • Jarek Czekalski

    Jarek Czekalski - 2012-08-04
    • assigned_to: nobody --> jarekczek
    • status: open --> closed-accepted
     
  • Jarek Czekalski

    Jarek Czekalski - 2012-08-04

    r21973

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks