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

use SCHED_BATCH scheduling priority for indexing threads #537

Closed
wants to merge 1 commit into from

Conversation

eklitzke
Copy link
Contributor

@eklitzke eklitzke commented Dec 3, 2019

This uses sched_setscheduler(2) to set the Linux SCHED_BATCH policy for indexing threads. This will only work on Linux, on other Posix platforms the implementation of setBatchPriority() will be guarded out by an ifdef (arguably on other Posix systems you could set a nice value as an alternative to using SCHED_BATCH).

There's a good overview of this feature in sched(7) and some benchmarks comparing it to nice values here. Note that the scheduling policy is a separate concept than nice values, so users can still renice ccls processes.

The motivation for this change is to make ccls work a bit better on my workstation when I'm using other interactive programs (emacs itself, firefox, etc.) but also indexing a large amount of code.

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.

1 participant