python-wheel-build / fromager

Build your own wheels
https://pypi.org/project/fromager/
Apache License 2.0
3 stars 9 forks source link

add timing information to show how long it takes to build a wheel #178

Closed dhellmann closed 1 month ago

dhellmann commented 1 month ago

It would be useful if the wheel building step of bootstrap, build, and build-sequence reported how long the wheel build takes. We can use that information to split up test jobs that are rebuilding a sequence of items, for example.

rd4398 commented 1 month ago

Should this information be logged out as info using logger.info()?

dhellmann commented 1 month ago

Maybe there is an existing log message where we could add the info? Like when we say that we've finished building a wheel, we could include the duration in that message?

rd4398 commented 1 month ago

Okay, will check!

rd4398 commented 1 month ago

I have the following questions / clarifications:

  1. The bootstrap command uses handle_requirement() which in turn gives call to wheels.build_wheel(). Should we add timing information only for the wheels.build_wheel() call or the entire function handle_requirement() or entire function build_wheel() present in wheels.py. Also, the log message for "finishing building a wheel" exists in handle_requirement() where I plan to add timing information.

  2. The build and build-sequence command uses a private method _build() which in turn gives call to wheels.build_wheel(). So do we time the wheels.build_wheel() call or entire _build() private method? Also, there are no log messages in _build() indicating completion of wheel building process and neither does build_wheel() in wheels.py. I plan to add a log message which will show the time required to build the wheel.

  3. Should the time be displayed in seconds or in a specific format like hh:mm:ss?

dhellmann commented 1 month ago

I have the following questions / clarifications:

  1. The bootstrap command uses handle_requirement() which in turn gives call to wheels.build_wheel(). Should we add timing information only for the wheels.build_wheel() call or the entire function handle_requirement() or entire function build_wheel() present in wheels.py. Also, the log message for "finishing building a wheel" exists in handle_requirement() where I plan to add timing information.

I'm most interested in the wheel build time, since that takes the longest of any operation.

Would it make sense to move that log message into build_wheel()?

  1. The build and build-sequence command uses a private method _build() which in turn gives call to wheels.build_wheel(). So do we time the wheels.build_wheel() call or entire _build() private method? Also, there are no log messages in _build() indicating completion of wheel building process and neither does build_wheel() in wheels.py. I plan to add a log message which will show the time required to build the wheel.

Same answer, I think.

  1. Should the time be displayed in seconds or in a specific format like hh:mm:ss?

Some of these builds take a lot of seconds. Pick something that would be easy to understand for a build that takes 30-45 minutes as well as one that takes less than 1 minute.

rd4398 commented 1 month ago

okay! will do Thanks