HaxeFoundation / hashlink

A virtual machine for Haxe
https://hashlink.haxe.org/
MIT License
812 stars 158 forks source link

[hlc] Use precompiled headers in vs templates #721

Closed tobil4sk closed 3 weeks ago

tobil4sk commented 3 weeks ago

Instead of having to recompile the headers for each individual source file, the headers are now compiled once for the whole project. This gives a further speed up from ~7 seconds to ~3 seconds.

ncannasse commented 3 weeks ago

Last time I tried that on our projects it turned out to be a big slow down instead. But @yuxiaomao can confirm that

Le ven. 25 oct. 2024 à 19:07, tobil4sk @.***> a écrit :

Instead of having to recompile the headers for each individual source file, the headers are now compiled once for the whole project. This gives a further speed up from ~7 seconds to ~3 seconds.

You can view, comment on, or merge this pull request online at:

https://github.com/HaxeFoundation/hashlink/pull/721 Commit Summary

File Changes

(12 files https://github.com/HaxeFoundation/hashlink/pull/721/files)

Patch Links:

— Reply to this email directly, view it on GitHub https://github.com/HaxeFoundation/hashlink/pull/721, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHZXQFL55Q65HIT7F5P7YLZ5J3FLAVCNFSM6AAAAABQTV4HX2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGYYTINRWHE2TQMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

yuxiaomao commented 3 weeks ago

Tested on shiro's project on my machine. It's better than the current template, and can be useful if we merge; but is still a "big slow down" compared to the 1 file strategy that is currently in use for the project.

Template Time
Current vs2019 template with your /Fo optimization 828-862s (14 mins)
With this PR 330-372s (6 mins)
Current ci template (all-in-one C file, no HL_MAKE) 57-91s (1.5 mins)

(Last week I tested the current template and it takes me 408s (7mins), still worse than this PR but take less time. I suppose the perf is never stable :/)

Simn commented 3 weeks ago

Comparing a single-file compilation to this doesn't seem particularly fair. If you do that you'd have to take into the account incremental compilation, which should make a huge difference.

yuxiaomao commented 3 weeks ago

Agree. My point is this PR is good and we can merge it. And the comparison for the single-file is only for comparison, as @tobil4sk discussed with me previously about having a template that can choose to activate single-file compilation with some -D hlgen flag.

ncannasse commented 3 weeks ago

Yes but we found actually difficult to keep having exactly same output when going through compiler cache. Maybe it's better now.

Le lun. 28 oct. 2024 à 10:02, Simon Krajewski @.***> a écrit :

Comparing a single-file compilation to this doesn't seem particularly fair. If you do that you'd have to take into the account incremental compilation, which should make a huge difference.

— Reply to this email directly, view it on GitHub https://github.com/HaxeFoundation/hashlink/pull/721#issuecomment-2440929576, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHZXQD4KK2KUVYLYZN5AVLZ5XVQLAVCNFSM6AAAAABQTV4HX2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDINBQHEZDSNJXGY . You are receiving this because you commented.Message ID: @.***>