I have a number of PB programs that use quite large amounts of embedded (IncludeBinary) files. The ASM backend compiles these very quickly, but the C backend labours, often taking over a minute on programs where the included binaries sum to over 30mb in size - They can also use over 6gb of RAM whilst doing so.
After a quick investigation it turns out that the C compiler simply takes a long time to work with the large unsigned char arrays that the IncludeBinary function generates.
Below is a snippet to highlight the longer compile times you get when including some large binaries (file chosen based on standard Windows PB install location, change as required):
Code: Select all
;/ ~35mb of included data... 50 seconds to compile on 13900h.
DataSection
test1: ; ~8 seconds to compile, ~700mb ram usage during compile
IncludeBinary "C:\Program Files\PureBasic\PureBasic.exe"
test2: ; ~18 seconds to compile, ~1.4gb ram usage during compile
IncludeBinary "C:\Program Files\PureBasic\PureBasic.exe"
test3:
IncludeBinary "C:\Program Files\PureBasic\PureBasic.exe"
test4:
IncludeBinary "C:\Program Files\PureBasic\PureBasic.exe"
test5:
IncludeBinary "C:\Program Files\PureBasic\PureBasic.exe"
EndDataSection
Any chance of adopting this if it's available to you? Thanks.