Skip to content
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

Stevie-O
Copy link
Contributor

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.)

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();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, can you correct the indentation while touching the code

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
@Stevie-O Stevie-O deleted the slow-startup-with-glib-2.49.3 branch March 22, 2017 01:20
ailin-nemui added a commit to ailin-nemui/irssi that referenced this pull request Dec 7, 2017
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants