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

analyzer: use sync.Pool to re-use ruleguard runner state #416

Merged
merged 1 commit into from
Oct 2, 2022

Conversation

quasilyte
Copy link
Owner

For some test runs, this allows to allocate ~10 state objects instead of ~3000 without such pool.

Allocating a runner state is an expensive operation, we want to re-use as much state as possible to make ruleguard faster.

This patch should be used as an example of how ruleguard can be integrated into go/analysis framework while still having a reusable state between the engine runs.

For some test runs, this allows to allocate ~10 state objects
instead of ~3000 without such pool.

Allocating a runner state is an expensive operation, we
want to re-use as much state as possible to make ruleguard faster.

This patch should be used as an example of how ruleguard
can be integrated into `go/analysis` framework while still
having a reusable state between the engine runs.
@quasilyte quasilyte merged commit 1204f12 into master Oct 2, 2022
@quasilyte quasilyte deleted the quasilyte/syncpool branch October 2, 2022 18:16
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

1 participant