Closed tobil4sk closed 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
- cc259ca https://github.com/HaxeFoundation/hashlink/pull/721/commits/cc259ca187199e13466dd7155acff3578872bc5c [hlc] Use precompiled headers in vs templates
File Changes
(12 files https://github.com/HaxeFoundation/hashlink/pull/721/files)
- M other/haxelib/templates/vs2015/file.vcxproj https://github.com/HaxeFoundation/hashlink/pull/721/files#diff-3fc0ea32a504c7d5b08aaf612893eae033b1a4ea6a2ab78540f622e37580dd62 (13)
- M other/haxelib/templates/vs2015/file.vcxproj.filters https://github.com/HaxeFoundation/hashlink/pull/721/files#diff-14d62eef758ec42ce062fcde595a990d845c0df129e47b3d84e5d5edf8d10412 (3)
- A other/haxelib/templates/vs2015/stdafx.c https://github.com/HaxeFoundation/hashlink/pull/721/files#diff-eff9bf701645b6d5fc0bf2fce59ad8077b87f363af4370ce3e546b1773593e6a (1)
- A other/haxelib/templates/vs2015/stdafx.h https://github.com/HaxeFoundation/hashlink/pull/721/files#diff-07c9cf19850eb63d1d60f73747028be0034e8f43aa4730d053a07ded67ff81b9 (5)
- M other/haxelib/templates/vs2017/file.vcxproj https://github.com/HaxeFoundation/hashlink/pull/721/files#diff-02e70db1648775737be1b86b9aade04c59aed14e36943fa16542c9aabd90f19d (13)
- M other/haxelib/templates/vs2017/file.vcxproj.filters https://github.com/HaxeFoundation/hashlink/pull/721/files#diff-7c77caf6f98e710d7c1a96c4dc3f2f6d2f43d924914d39fbf334ac4e009dc940 (3)
- A other/haxelib/templates/vs2017/stdafx.c https://github.com/HaxeFoundation/hashlink/pull/721/files#diff-65f07a36f6a63702add1ae45f2440bb0ea65f8de070220d41d46fbfa76d75016 (1)
- A other/haxelib/templates/vs2017/stdafx.h https://github.com/HaxeFoundation/hashlink/pull/721/files#diff-393c601ab3a80003c242f722daec938e8b8ba7f549707fa5e5fde1e957c41293 (5)
- M other/haxelib/templates/vs2019/file.vcxproj https://github.com/HaxeFoundation/hashlink/pull/721/files#diff-61337d715563665db86099196c470cd7c7fd2a76f8e1fdfb64628c6fcd1e11ef (13)
- M other/haxelib/templates/vs2019/file.vcxproj.filters https://github.com/HaxeFoundation/hashlink/pull/721/files#diff-4c0b4e80722f643586a5dc7c06157ec1d06087d9cb61ba541215af7edf6fc67f (3)
- A other/haxelib/templates/vs2019/stdafx.c https://github.com/HaxeFoundation/hashlink/pull/721/files#diff-ba9d5e6cad69992caac9c594688f7fa9de23ad0856d801f978ffddcdbcea1a73 (1)
- A other/haxelib/templates/vs2019/stdafx.h https://github.com/HaxeFoundation/hashlink/pull/721/files#diff-e700e9e22cb42899cf2213af380ad8793c3bf2fcd2c6ff23a9c364cce92e1b9c (5)
Patch Links:
- https://github.com/HaxeFoundation/hashlink/pull/721.patch
- https://github.com/HaxeFoundation/hashlink/pull/721.diff
— 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: @.***>
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 :/)
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.
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.
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: @.***>
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.