[This is an improved version of the change that has a better mechanism for 
choosing tag-selector rules and further improves the performance.]

Change ptw-20110302-zEx by [email protected] on 2011-03-02 18:20:29 EST
    in /Users/ptw/OpenLaszlo/trunk-devo
    for http://svn.openlaszlo.org/openlaszlo/trunk

Summary: Improve CSS rule parsing

Bugs Fixed: LPP-9785 CSS Parser needs to break up parsing of large rule sets 
(partial)

Technical Reviewer: [email protected] (pending)
QA Reviewer: [email protected] (pending)

Overview:
    Rethink how to partition rules into cohorts:  base on ability to
    discriminate applicability quickly, not on specificity.  Remove
    concat-ing of applicable rules (which is a big overhead in
    time/space for large rule sets), replace with state machine that
    examines rules for applicability and only concats when
    applicable.  For tag selectors, each LZX class lists only the tags
    that it is a subclass of, so that only applicable tag rules are
    examined.


Details:
    huge.css:  Large CSS ruleset for testing

    speedtest.lzx:  Use huge.css, add many styled subviews for lookup
    test.

    lfc/*:  Manually declare __LZCSSTagSelectors for the LFC classes
    that define tags.

    LzCSSStyle: See overview.  Also: conditionalize debug printer,
    replace StyleDependencies object with a closure, break out
    [name=...] rules to their own cohort, use class tag information to
    choose tag selectors, only call the compound rule evaluator when
    the last selector completely matches.

    ClassModel:  Compute __LZCSSTagSelectors for all classes.

    StyleSheetCompiler:  Sort rules at compile time by specificity to
    reduce runtime sorting overhead.

Tests:
    smokecheck, style/metasuite

Files:
A       test/style/constraints/huge.css
M       test/style/constraints/speedtest.lzx
M       WEB-INF/lps/lfc/services/LzCSSStyle.lzs
M       WEB-INF/lps/lfc/core/LzNode.lzs
M       WEB-INF/lps/lfc/views/LzInputText.lzs
M       WEB-INF/lps/lfc/views/LzText.lzs
M       WEB-INF/lps/lfc/views/LaszloView.lzs
M       WEB-INF/lps/lfc/views/LaszloCanvas.lzs
M       WEB-INF/lps/lfc/animators/LzAnimatorGroup.lzs
M       WEB-INF/lps/lfc/animators/LaszloAnimation.lzs
M       WEB-INF/lps/lfc/helpers/LzContextMenu.lzs
M       WEB-INF/lps/lfc/helpers/LzState.lzs
M       WEB-INF/lps/lfc/data/LzDatapointer.lzs
M       WEB-INF/lps/lfc/data/LzDataset.lzs
M       WEB-INF/lps/lfc/data/LzDatapath.lzs
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/StyleSheetCompiler.java
M       WEB-INF/lps/server/src/org/openlaszlo/compiler/ClassModel.java

Changeset: http://svn.openlaszlo.org/openlaszlo/patches/ptw-20110302-zEx.tar

Reply via email to