[Lazarus] [patch] lhelp scrolling slowness - I might have found it

Bernd prof7bit at googlemail.com
Sun Dec 25 19:46:25 CET 2011


2011/12/25 Bernd <prof7bit at googlemail.com>:

> every scroll event. The next step should be to find out what exactly
> is going on during a scroll event that causes this to happen every
> time.

Its a bit complicated. It looks up not only the tag name but also
"tag:hover", "tag.class", ".class" and id. And then it merges them all
one after the other into the properties of this tag. And then after
merging these properties this function does something very strange: It
returns one of these 5 property objects back to the caller but it is
not clear which one and for what purpose and also it does not load
tagname.classname if it already has successfully loaded tagname and
other such strange things, very confusing.

I have therefore rewritten the LoadCSSProps() method from scratch and
also added a method to merge two TCSSProps into one (and then let
LoadCSSProps() return an obect with all CSS styles combined) and also
some caching of all these props objects to avoid all the lookups by
name.

The patch is not easy to read without applying because the old and the
new version of LoadCSSProps() has been interleaved with each other
every 5 lines although they do not have much in common.

This patch will probably break some things (or maybe also fix some old
bugs?) I cannot see any visual difference in the lhelp application.
Maybe the person who wrote all this should now say something before
this is blindly applied. This patch changes some of the control flow
and constitutes only my interpretation of what I believe
LoadCSSProps() was initially supposed to do. But the whole ipro
package is a *lot* of code and so it is quite possible that I
misunderstood parts of the code.

Bernd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lhelp_turbopower_ipro_cssprops_caching_v1.patch
Type: text/x-diff
Size: 14114 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20111225/2c6cac9b/attachment-0001.patch>


More information about the Lazarus mailing list