[webkit-gtk] WK2/JSC idle wakeups and CPU utilisation

Carlos Garcia Campos cgarcia at igalia.com
Sun Dec 3 01:02:26 PST 2017


El dom, 03-12-2017 a las 13:44 +1100, Michael Gratton escribió:
> Hi all,

Hey Michael,

> Since porting Geary to WebKit2, I have noticed it seems to have been 
> running hotter than previously when idle. This has also been
> reported 
> by others in Bug 783025[0]. One person noticed using strace that
> when 
> Geary is on the visible desktop, it is calling and returning from 
> poll() at about 60 times per second, which is a substantial number
> of 
> wakeups for an idle application.

60 times per second and when visible sounds like the paint timer.

>  This seems to also occur for Epiphany, 
> but not in other GTK+ apps such as Gitg, or Polari. Hence it looks
> like 
> a WebKit2 issue.

Doesn't gitg use webkit2 as well?

> I'm noticing it under Wayland, and have a query out in that bug as
> to 
> whether others are seeing it under X11. The poll() rate decreases
> when 
> it is not on the visible desktop, and I've managed to get the rate
> down 
> a bit as well by ensuring Geary is not showing a WebView, but these 
> aren't terribly useful workarounds. Geary is setting 
> WEBKIT_DISABLE_COMPOSITING_MODE=1 in main() right after launching,
> but 
> commenting that out doesn't seem to make any difference.

Please don't do that, the env var is not expected to be used by
applications, only for users/developers as a debug tool. Use
webkit_settings_set_hardware_acceleration_policy() instead.

>  I also tried 
> commenting out the ~6 JS message handlers that Geary uses for 
> displaying conversations, but that didn't help either.
> 
> Sysprof shows that most of the work being done when idle is in 
> g_main_context_prepare() — 21% of the total, g_source_iter() — 17% 
> of total, and magazine_cache_push_magazine (used by g_slice) — 12%. 
> Most of the work being done by calls to g_source_iter are being made 
> from libjavascriptcoregtk-4.0.so — accounting for 13% of the total 
> work when idle.
> 
> Is this to be expected or is it a bug?

File bug report, please. If you can attach strace, sysprof, etc output
and anything else that could help to identify the source of the wake
ups.

Thanks!

> Cheers,
> //Mike
> 
> 
> [0] - <https://bugzilla.gnome.org/show_bug.cgi?id=783025>
> 
-- 
Carlos Garcia Campos
http://pgp.rediris.es:11371/pks/lookup?op=get&search=0xF3D322D0EC4582C3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 195 bytes
Desc: This is a digitally signed message part
URL: <http://lists.webkit.org/pipermail/webkit-gtk/attachments/20171203/caf23c49/attachment.bin>


More information about the webkit-gtk mailing list