Skip to content

Conversation

PawelSwider2000
Copy link
Contributor

@PawelSwider2000 PawelSwider2000 commented Oct 8, 2025

Observed that recompilations are triggered by updating files by install_xpu_headers.py script. Turns out that script does not change the files in any way but rewriting the same content into files updating their timestamp causing multiple dependent files to recompile.

This PR makes sure that install_xpu_headers.py changes or creates files only when content should change. This allow to speedup recompilations several times, by my experience from few minutes to few seconds.

This fixes: #2093

Copy link
Contributor

@guangyey guangyey left a comment

Choose a reason for hiding this comment

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

LGTM.

@guangyey
Copy link
Contributor

guangyey commented Oct 8, 2025

Thanks!

@Copilot Copilot AI review requested due to automatic review settings October 8, 2025 12:11
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR optimizes the install_xpu_headers.py script to avoid unnecessary file modifications that trigger recompilations. The script now only writes files when their content actually changes, preventing timestamp updates that cause dependent files to recompile unnecessarily.

  • Adds content comparison logic to prevent unnecessary file writes
  • Implements binary file comparison for copied files to detect actual changes
  • Adds conditional writing for both header files and CMake configuration files

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@guangyey
Copy link
Contributor

guangyey commented Oct 9, 2025

Build pass, irrelevant error.

@guangyey guangyey added this pull request to the merge queue Oct 9, 2025
Merged via the queue into main with commit fe324d3 Oct 9, 2025
20 of 24 checks passed
@guangyey guangyey deleted the dev/pswider/recompilation-speedup branch October 9, 2025 01:12
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.

Every second rebuild took significantly more time.

3 participants