CosmosOS / IL2CPU

IL2CPU is a compiler for .NET IL code to compile to assembly language for direct booting.
BSD 3-Clause "New" or "Revised" License
279 stars 71 forks source link

Fix ManifestResourceStream speed: Use assembler directive `incbin` instead of outputting the binary to the asm output #200

Closed GoldenretriverYT closed 1 year ago

GoldenretriverYT commented 1 year ago

Fixes ManifestResourceStreams speed using the incbin NASM/YASM assembler directive. This includes binary directly from an external file which is a lot faster than using a huge db instruction.

30mb file:

Before:
  1>IL2CPU task took 00:00:36.5974656
  1>-g dwarf2 -f elf -o bin\Debug\net6.0\nxtlvlOS.obj -dELF_COMPILATION -O2 bin\Debug\net6.0\nxtlvlOS.asm
  1>Yasm task took 00:06:10.1939569
After:
  1>IL2CPU task took 00:00:23.8534121
  1>-g dwarf2 -f elf -o bin\Debug\net6.0\nxtlvlOS.obj -dELF_COMPILATION -O2 bin\Debug\net6.0\nxtlvlOS.asm
  1>Yasm task took 00:00:10.8834183
GoldenretriverYT commented 1 year ago

Depends on XSharp pr https://github.com/CosmosOS/XSharp/pull/68, forgot to mention that

edit: fixes https://github.com/CosmosOS/Cosmos/issues/2705

terminal-cs commented 1 year ago

So is this gonna be merged or what

stephencomputer commented 1 year ago

Yeah, this would save many hours of time especially when using high resolution images.