Skip to content

Use temporary directory for intermediate .ll files#6356

Open
xoxorwr wants to merge 1 commit intoodin-lang:masterfrom
xoxorwr:tmp
Open

Use temporary directory for intermediate .ll files#6356
xoxorwr wants to merge 1 commit intoodin-lang:masterfrom
xoxorwr:tmp

Conversation

@xoxorwr
Copy link

@xoxorwr xoxorwr commented Mar 2, 2026

Most systems are configred so that /tmp is essentially a ramdisk, so this PR:

  • reduces unnecessary disk i/o and wear on SSDs (~30mb on my project everytime i save for hotreload)
  • speeds up optimization and linking phases

This is basically a copy paste of lb_filepath_obj_for_module's logic

@xoxorwr xoxorwr marked this pull request as ready for review March 2, 2026 07:43
@laytan
Copy link
Collaborator

laytan commented Mar 2, 2026

Does -keep-temp-files keep the old behavior?

@xoxorwr
Copy link
Author

xoxorwr commented Mar 2, 2026

Does -keep-temp-files keep the old behavior?

Yes, behavior remain unchanged, it just change the direectory

I should add that this PR should be tested on Windows, I don't have a windows machine with me right now

@gingerBill
Copy link
Member

Yes, behavior remain unchanged, it just change the direectory

As silly as this sounds but that is changing the behaviour though.

I recommend allowing a way to opt-out of the directory behaviour is possible, and not just put it in a random /tmp directly. The point of stuff of the command -keep-temp-files is to be able to easily inspect where things went wrong, so placing it in a hard to find temp directory isn't a good idea.

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