compiling for windows

Discussion of chess software programming and technical issues.

Moderator: Ras

User avatar
flok
Posts: 539
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

compiling for windows

Post by flok »

Hi,

Until now I always compiled e.g. Dog using mingw to target windows.
I just noticed it produces a binary that is 13x slower than the linux program on the same laptop.
How do you people cross-compile while maintaining the original speed of your program?
User avatar
Ras
Posts: 2671
Joined: Tue Aug 30, 2016 8:19 pm
Full name: Rasmus Althoff

Re: compiling for windows

Post by Ras »

flok wrote: Sat Jan 04, 2025 2:05 pmI just noticed it produces a binary that is 13x slower than the linux program on the same laptop.
That doesn't sound normal.
How do you people cross-compile while maintaining the original speed of your program?
Under Linux, with the gcc-mingw-w64 package collection available in the normal distro repo. Just checked the native Linux compile vs. the Windows executable under Wine, and native is just 2% faster.
Rasmus Althoff
https://www.ct800.net
mar
Posts: 2626
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: compiling for windows

Post by mar »

factor 13 almost sounds like it's been built with optimizations disabled
mar
Posts: 2626
Joined: Fri Nov 26, 2010 2:00 pm
Location: Czech Republic
Full name: Martin Sedlak

Re: compiling for windows

Post by mar »

and turns out I was right: 2.6 definitely is a debug build with optimizations disabled - looking at the disassembly in IDA:
nothing is inlined, every local spilled on stack, asserts compiled in and all over the place

ergo obviously not mingw's fault
User avatar
flok
Posts: 539
Joined: Tue Jul 03, 2018 10:19 am
Full name: Folkert van Heusden

Re: compiling for windows

Post by flok »

mar wrote: Sat Jan 04, 2025 11:52 pm and turns out I was right: 2.6 definitely is a debug build with optimizations disabled - looking at the disassembly in IDA:
nothing is inlined, every local spilled on stack, asserts compiled in and all over the place

ergo obviously not mingw's fault
Ah!
Sounds plausible indeed.