Skip to content

reduce the interrupt check rate - #5989

Open
ab9rf wants to merge 1 commit into
DFHack:developfrom
ab9rf:lua-interrupts
Open

ab9rf wants to merge 1 commit into
DFHack:developfrom
ab9rf:lua-interrupts

Conversation

@ab9rf

@ab9rf ab9rf commented Oct 1, 2026

Copy link
Copy Markdown
Member

This PR lowers the rate at which the Lua VM checks to see if it's been asked to die (using the kill-lua command) from once every 256 to once every 16384 instructions. Empirical testing indicates that rate still results in the interrupt flag being checked at least once every 10 milliseconds or so, which should be more than fit for purpose.

The instrumentation used to gather the testing data is left in place; at the new lowered interrupt frequency, the cost of gathering it is negligible.

This PR lowers the rate at which the Lua VM checks to see if it's been asked to die (using the`kill-lua` command) from once every 256 to once every 16384 instructions. Empirical testing indicates that rate still results in the interrupt flag being checked at least once every 10 milliseconds or so, which should be more than fit for purpose.

The instrumentation used to gather the testing data is left in place; at the new lowered interrupt frequency, the cost of gathering it is negligible.
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