Skip to content

Add something like rustc's -Z time-passes #933

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

Closed
fitzgen opened this issue Aug 25, 2017 · 2 comments
Closed

Add something like rustc's -Z time-passes #933

fitzgen opened this issue Aug 25, 2017 · 2 comments

Comments

@fitzgen
Copy link
Member

fitzgen commented Aug 25, 2017

This would give a high level overview of how long each of our phases are taking, and help inform us where we should generally be focusing our performance investigations on various test cases.

@fitzgen
Copy link
Member Author

fitzgen commented Aug 25, 2017

Specifically, I'm imagining

  • a new module that provides RAII types for timing start and end of some phase, and printing the timed value in the Drop implementation,
  • the ability to turn those RAII timers on/off dynamically via a command line flag and builder option,
  • and then instrumentation of the code base with these RAII timers for all of:
    • libclang -> IR parsing (bindgen::parse)
    • each of our analyses (eg bindgen::ir::BindgenContext::compute_cannot_derive_debug)
    • bindgen::ir::BindgenContext::process_replacements
    • bindgen::ir::BindgenContext::compute_whitelisted_and_codegen_items
    • IR -> Rust source code (bindgen::codegen::codegen)

@jhod0
Copy link
Contributor

jhod0 commented Aug 30, 2017

@fitzgen I implemented something along these lines, let me know if it's what you had in mind (PR #938)

bors-servo pushed a commit that referenced this issue Aug 31, 2017
Time phases

New module `time_phases` with an RAII timer which prints to stderr, and command-line flag `--time-phases` to enable it.

Fixes #933
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants