New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix slow startup with glib 2.49.3 #680

Merged
merged 2 commits into from Mar 21, 2017

Conversation

Projects
None yet
2 participants
@Stevie-O
Contributor

Stevie-O commented Mar 21, 2017

In glib v2.49.3, an optimization was made to eliminate certain
unnecessary wakeups. (The specific change was made in
e4ee3079c5afc3c1c3d2415f20c3e8605728f074). Before this change, the
first call to g_main_iteration would always complete immediately.
In Irssi, this effectively reversed the order of the main loop, causing
the reload_config check and the dirty_check to run before the first
blocking call to g_main_iteration.

With the new logic, the first g_main_iteration call now blocks,
preventing the screen from being refreshed until the user starts typing
or a timer goes off. (It also delays processing of SIGHUP, but I
expect that is not a common situation.)

This commit reorders the main loop to wait at the end of the loop,
rather than the beginning, addressing the problem.

(This closes Debian bug #856201.)

Fix delay at startup when running against glib 2.49.3+
In glib v2.49.3, an optimization was made to eliminate certain
unnecessary wakeups.  (The specific change was made in
e4ee3079c5afc3c1c3d2415f20c3e8605728f074). Before this change, the
first call to g_main_iteration would always complete immediately.
In Irssi, this effectively reversed the order of the main loop, causing
the reload_config check and the dirty_check to run *before* the first
blocking call to g_main_iteration.

With the new logic, the first g_main_iteration call now blocks,
preventing the screen from being refreshed until the user starts typing
or a timer goes off.  (It also delays processing of SIGHUP, but I
expect that is not a common situation.)

This commit reorders the main loop to wait at the end of the loop,
rather than the beginning, addressing the problem.

(This closes Debian bug #856201.)
term_refresh_freeze();
g_main_iteration(TRUE);
term_refresh_thaw();

This comment has been minimized.

@ailin-nemui

ailin-nemui Mar 21, 2017

Contributor

nit, can you correct the indentation while touching the code

Intentation/whitespace fixes
Change several instances of space-indentation to tabs, matching the
surrounding code.

@ailin-nemui ailin-nemui merged commit 3d4ba86 into irssi:master Mar 21, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@Stevie-O Stevie-O deleted the Stevie-O:slow-startup-with-glib-2.49.3 branch Mar 22, 2017

ailin-nemui added a commit to ailin-nemui/irssi that referenced this pull request Dec 7, 2017

Merge pull request irssi#680 from Stevie-O/slow-startup-with-glib-2.49.3
Fix slow startup with glib 2.49.3
(cherry picked from commit 3d4ba86)

@ailin-nemui ailin-nemui added this to the 1.0.3 milestone Jan 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment