Skip to content

css: Reshuffle the inner loop of value computation

Matthias Clasen requested to merge matthiasc/css-value-inner-loop into master

The loop over all properties in gtk_css_static_style_compute_values is the inner loop of the css value computation, we hit it thousands of times per frame. Rearrange things to make this faster, by avoiding function calls, pulling the section handling out into a separate loop, and handling the border-width special case in a neater way.

Before: 50 runs, min 12.45, max 20.419, avg 15.9414

After: 50 runs, min 12.622, max 21.195, avg 15.0449

Edited by Matthias Clasen

Merge request reports