Menu

#927 PositionCache modifications

Won't_Implement
closed
Scintilla (390)
2
2012-07-14
2012-04-14
No

Attached are two patches:

1. Allow specifying PositionCache initial size in constructor. This avoids unnecessary allocating memory twice on Editor class construction.

2. Use separate PositionCache for printing in order to stop invalidating PositionCache that's used for screen.

Discussion

  • Marko Njezic

    Marko Njezic - 2012-04-14
     
  • Marko Njezic

    Marko Njezic - 2012-04-14
     
  • Neil Hodgson

    Neil Hodgson - 2012-04-16

    I don't see these as big enough wins to be worth applying.

     
  • Neil Hodgson

    Neil Hodgson - 2012-04-16
    • assigned_to: nobody --> nyamatongwe
     
  • Marko Njezic

    Marko Njezic - 2012-04-16

    1. Fixes bad coding. You're allocating memory first in PositionCache constructor, just to trash it away immediately afterwards by calling SetSize() method in Editor constructor.

    2. This may seem small to you, since you're only thinking about SciTE-like applications that use single instance for all documents in which case PositionCache gets invalidated anyway on every document switch. However, applications that use one instance per document can afford to keep PositionCache valid quite longer and there is no need to trash it on every call to FormatRange. The same goes for the first patch, in SciTE you're only performing double allocation twice, while applications that use one instance per document will perform double allocation on every new document.

     
  • Neil Hodgson

    Neil Hodgson - 2012-04-17
    • priority: 5 --> 2
    • milestone: --> Won't_Implement
     
  • Neil Hodgson

    Neil Hodgson - 2012-07-14
    • status: open --> closed
     

Log in to post a comment.