Skip to content

Performance of rendering large pages #356

@kobalicek

Description

@kobalicek

I'm not sure if anyone was looking into this already, but I have noticed a significant cycle consumer during my testing. The function litehtml::render_item::draw_children() shows ~18% cycle consumption during rendering a larger page where not all elements are visible (many are scrolled out).

I think the culprit is the following:

    for (const auto& el : m_children)
    {
        if (el->is_visible())
        {
            ...
        }
    }

I'm not entirely sure why yet - I think when the element count is large it's going to cache miss most items in the list (so it has to wait) twice (the list item itself and then the shared_ptr access) to just check that it's not visible.

I'm using litehtml with a Blend2D renderer, so it's possible that this is not as significant when used with other renderers.

BTW feel free to close, I'm opening mostly for a possible discussion and to verify whether there would be will to optimize rendering of larger pages in the future. This would need to reengineer this a little, and maybe I could bring some ideas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions