Commit 6261017
committed
Disable Clang optimizations for
Clang was taking around 10 minutes to compile
`slang-embedded-core-module-source.cpp` with optimizations. Disabling
optimizations for these functions reduced the compilation time to about
12 seconds on my machine (Intel Core Ultra 7 165H), and had no
noticeable impact on run-time performance.
Run-time performance with optimizations:
```
$ hyperfine --shell=none './build/generators/Release/bin/slang-bootstrap -archive-type riff-lz4 -save-core-module-bin-source slang-core-module-generated.h -save-glsl-module-bin-source slang-glsl-module-generated.h'
Benchmark 1: ./build/generators/Release/bin/slang-bootstrap -archive-type riff-lz4 -save-core-module-bin-source slang-core-module-generated.h -save-glsl-module-bin-source slang-glsl-module-generated.h
Time (mean ± σ): 2.545 s ± 0.035 s [User: 2.333 s, System: 0.210 s]
Range (min … max): 2.496 s … 2.620 s 10 runs
```
Run-time performance without optimizations:
```
$ hyperfine --shell=none './build/generators/Release/bin/slang-bootstrap -archive-type riff-lz4 -save-core-module-bin-source slang-core-module-generated.h -save-glsl-module-bin-source slang-glsl-module-generated.h'
Benchmark 1: ./build/generators/Release/bin/slang-bootstrap -archive-type riff-lz4 -save-core-module-bin-source slang-core-module-generated.h -save-glsl-module-bin-source slang-glsl-module-generated.h
Time (mean ± σ): 2.564 s ± 0.039 s [User: 2.350 s, System: 0.213 s]
Range (min … max): 2.512 s … 2.614 s 10 runs
```
Disabling optimizations also makes
`slang-embedded-core-module-source.cpp.o` slightly smaller:
- 7.84 MiB with optimizations,
- 7.37 MiB without optimizations.
Fixes #9054.Session::get*LibraryCode() functions1 parent 1152af7 commit 6261017
File tree
1 file changed
+11
-0
lines changed- source/slang-core-module
1 file changed
+11
-0
lines changedLines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
326 | 326 | | |
327 | 327 | | |
328 | 328 | | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
329 | 336 | | |
330 | 337 | | |
331 | 338 | | |
| |||
382 | 389 | | |
383 | 390 | | |
384 | 391 | | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
0 commit comments