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 FILE * instead of filenames when passing file paths to serialization and printing commands #968

Merged
merged 9 commits into from
Feb 7, 2024

Conversation

dwightguth
Copy link
Collaborator

Previously we were storing a filename in a global variable and then passing it to a bunch of functions. Each of these functions then had to call fopen and fclose, which was quite expensive. This PR changes the behavior so instead we once open a file with fopen at the start of rewriting, then call a bunch of functions which take a FILE * as an argument, then call fclose once at the end. This gets much better buffering behavior and reduces the number of syscalls considerably.

When measuring the performance of this code against a "sum to 10k" imp program with proof hint generation enabled, we saw a time reduction from 3.5m to 2m.

@dwightguth dwightguth marked this pull request as ready for review February 6, 2024 17:08
@dwightguth dwightguth requested review from Baltoli and gtrepta February 6, 2024 17:08
Copy link
Contributor

@Baltoli Baltoli left a comment

Choose a reason for hiding this comment

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

LGTM once conflicts are fixed!

bindings/python/runtime.cpp Show resolved Hide resolved
@dwightguth dwightguth merged commit 049f2d0 into master Feb 7, 2024
7 checks passed
@dwightguth dwightguth deleted the use_files branch February 7, 2024 18:10
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.

3 participants