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

Slow pretty-printer and consistency checks #661

Open
fpoli opened this issue Mar 16, 2023 · 0 comments
Open

Slow pretty-printer and consistency checks #661

fpoli opened this issue Mar 16, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@fpoli
Copy link
Member

fpoli commented Mar 16, 2023

By profiling for 165 seconds a Carbon run with VisualVM I found that:

  • The time spent in the JVM is 53s, which is 32% of the wall-clock time.
  • Pretty-printing a boogie.Program takes 11s, which is 20% of the CPU time used by the JVM.
  • The consistency checks of a silver.ast.Program take 14s, which is 26% of the CPU time used by the JVM.

Ignoring the first point, which might be due to Carbon's implementation, pretty-printing and consistency checks take a nontrivial fraction of the time and are mostly implemented using Silver functions. There is probably room for improvement there, because it might be e.g. that a lot of the time is spent allocating the many closures used by the functional-style implementation of the pretty-printer.

A screenshot of the profiling, where the second column is the CPU time of the JVM ond the third is the overall execution time:
Screenshot from 2023-03-16 13-32-19

The measurements are done on just one set of 11 Viper programs, but the profiling shows that pretty-printing and consistency checks can be bottlenecks. Some stats about the concatenation of those Viper programs:

  • 636'489 lines of code (including empty lines and comments)
  • 2'486 domains, containing in total
    • 26'437 domain functions
    • 39'609 axioms
  • 135 top-level functions
  • 55 methods
  • 0 fields
  • 0 predicates
@fpoli fpoli added the enhancement New feature or request label Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant