Re: wxEditor v0.2 released

new topic     » goto parent     » topic index » view thread      » older message » newer message
Matt Lewis said...

Ok, loaded a big file, and then it was pretty slow. Actually, the easiest way to speed it up is to not redraw all the lines. In wxSyntax.e:redraw_line() I just did a naive cutoff of 100 lines (so it's drawing too many, but I figure it's unlikely to be showing more than that), and it performs much better:

    -- redraw lines 
    bottom = length( text ) 
    if bottom - top > 100 then 
    	bottom = top + 100 
    end if 
    for line = top to bottom do 
        redraw_line( this, line ) 
    end for 

Matt

Okay, yeah... I think found it. In redraw_buffer() I have this:

    -- redraw lines 
 
    for line = top to length( text ) do 
 
        redraw_line( this, line ) 
 
    end for 
 

But I think it should be something like this:

    -- calculate number of lines to drawn 
    bottom = top + maxlines 
    if bottom > length( text ) then 
        bottom = length( text ) 
    end if 
 
    -- redraw lines 
 
    for line = top to bottom do 
 
        redraw_line( this, line ) 
 
    end for 
 

I haven't tried it, but I suspect that's it. I never really noticed because I was always loading small-ish files.

-Greg

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu