Summary: | Extreme slowness drawing dashed lines | ||
---|---|---|---|
Product: | cairo | Reporter: | M Welinder <terra> |
Component: | general | Assignee: | Chris Wilson <chris> |
Status: | RESOLVED NOTOURBUG | QA Contact: | cairo-bugs mailing list <cairo-bugs> |
Severity: | normal | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | Other | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
M Welinder
2014-01-13 03:14:16 UTC
I don't really understand the code, but here is what I think I found. The 150ms timeout is implemented in item_cursor_realize() in item-cursor.c. For items with ->style == GNM_ITEM_CURSOR_ANTED it does this: ic->animation_timer = g_timeout_add (150, (GSourceFunc) cb_item_cursor_animation, ic); Looking at the callback function, we see that it just toggles ic->state and calls goc_item_invalidate() on the item. I haven't actually found that function's implementation, but debian code search gave me the following (goc_item_invalidate(item) just calls goc_item_maybe_invalidate(item, FALSE);): http://sources.debian.net/src/goffice/0.10.9-1/goffice/canvas/goc-item.c?hl=473#L451 This calculates the bounds of the items and invalidates that rectangle on the canvas. TL;DR: gnumeric redraws "basically all of its content" about 7 times per second and then wonders that this is slow. (Or did I miss something?) Re "this used to work fine for over a decade": The implementation a decade ago was more intelligent (I guess instead of redrawing things, it just drew the ant line ones and then used an XOR operator to "toggle the dashes/ants"). And valgrind --tool=callgrind says that 65% of CPU time is spent inside gnm_style_borders_row_draw() (unrelated code?) which itself spends most of its cpu time in cairo_stroke(). So the high cpu usage seems to come from some unrelated code which just happens to be executed more often due to the "ant lines". I don't see why this would be a cairo problem. Could you provide more information, perhaps some self-contained C code that shows cairo being slow? Thanks for the analysis and the effort. I am now able to reproduce the problem myself and work on it. Apologies for having suspected cairo: this was hitting a random set of machines suggesting something below gtk+. In fact, I now believe this is something as simple as different screen resolution. More pixels, more work. And pixels go up with resolution squared. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.