Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 13 of 13 total
Thread Beware autosize and layout
Wed, Sep 23 2015 12:22 PMPermanent Link

Matthew Jones

Raul wrote:

> "Everything old is new again" Smile

Indeed - I remember programming "GEM" on the PC and Atari, and we had
to take care not to touch the UI if we could help it. Better to keep
the last value and compare it in code to the new value, and not pass it
to the UI if nothing had changed. Thousands of cycles.

In this case, there is a particular method for the browser that appears
to be taking way longer than anything else. Presumably doing lots of
calculating line lengths etc. Completely wasted as it makes no
difference, but it doesn't know that. Several times a second and all
you do is sit waiting for that line...

--

Matthew Jones
Wed, Sep 23 2015 6:13 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< For the historical record, I've done more playing with this and Tim had a look. Basically, browsers are poor at measuring their sizes, so if you are going to be doing a lot of changing of edit boxes and probably other components too, then you need to be careful. It's a browser thing...  >>

Whoaa, hold on a second. Smile

The issue is with how the underlying text area elements work, not with general layout issues.  Text area elements, like all input elements in browsers, have but one "value" property.  Therefore, for something like what you're doing, the entire value has to be replaced every time you add a new line.  *That* is what is taking up so much time, and probably what is causing the scrollWidth property to take forever to recalculate.  What the text area elements need are a way to work with individual lines, something that they sorely lack.

EWB 2 does a very good of job of eliminating "touching the DOM in the browser" issues, so you shouldn't see any general performance issues with layout, resizing, etc., provided that you use BeginUpdate/EndUpdate for batch updates to controls.

This is especially true with the upcoming 2.02, which has optimized the layout handling of auto-sized, left/right-stretched, word-wrapped content.  That's what has improved the grid cell updating performance.  You can see the new performance in this example project on the site:

http://www.elevatesoft.com:8081/transactions/transactions.html

If you scroll up and down using the up-arrow/down-arrow/page-up/page-down keys, you will see that navigation is much quicker in grids now.  This optimization also applies to the TListBox control.

Tim Young
Elevate Software
www.elevatesoft.com
Thu, Sep 24 2015 4:04 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> The issue is with how

Thanks for adding all the detail. It certainly isn't something to worry
about unless you are being mad like me and updating a 2000 line
multi-line edit many times a second. 8-)  But if you are mad like me,
then there are ways around it...

--

Matthew Jones
« Previous PagePage 2 of 2
Jump to Page:  1 2
Image