mugdha kulkarni wrote:
1]It is been observed that editor  becomes slow in response if the size of
the file is in Kb.

I have seen the opposite effect. In terms of performance, I am experiencing that it is significantly faster than when using a RichEdit control in Windows. Files betwen 0.5-1MB take approx 1 second to load. I have also tried a 5.37MB file that takes a total of 7 seconds (including GUI refresh/responsiveness, but you can see the file text being displayed almost instantly).

2]Word Wrap feature further affects the response of editor.

I am using word-wrap with no significant performance lag.

Is there any way to improve performance of editor in  both of the above
cases.?

I built the scintilla library using Micosoft VC7.1 as a static library. I am calling the Scintilla API using the SendMessage interface (as opposed to direct access). This is being run on a WinXP SP2 laptop with a 1.3GHz Intel Celeron M processor and 248MB RAM.

I am using the following code to load the document:

        // Detect UTF8/16 BOM and call SetCodePage() accordingly.

        ClearAll();
        SetUndoCollection( false );
        char szBuffer[ 8192 ];

        DWORD dwRead = 0;
while( SUCCEEDED( stream -> Read( szBuffer, sizeof( szBuffer ), &dwRead )) && dwRead > 0 )
        {
           AddText( szBuffer, int( dwRead ));
        }

        SetCurrentPos( 0 );
        SetUndoCollection( true );
        SetSavePoint();

NOTE: This is using IStream objects as I was using the LoadStream to load the document into a RichEdit control. However, it should be easy to addapt this to use files (CreateFile, ReadFile, CloseHandle).

NOTE: I am using Scintilla in an MDI envronment with one Scintilla window per document.

HTH,
- Reece


_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to