flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > Why C++ programs are so big? Goto page Previous 1, 2, 3 |
Author |
|
Roman 14 Aug 2023, 15:11
You compiled c++ code as release ?
Or debug ? Maybe in exe c++ put some extra code, like security or some libs. Minimal visual studio c++ dll 10 kb On fasm 1kb dll |
|||
14 Aug 2023, 15:11 |
|
Flier-Mate 14 Aug 2023, 15:23
Roman wrote: You compiled c++ code as release ? Thanks for your reply, Roman. This is C, C doesn't have Release or Debug build. Last time I tried compile C++ "Hello, world" console app, and get 10,752 bytes, so you're right, it is about 10KB. FASM can be small, you're right again, 1024 bytes. |
|||
14 Aug 2023, 15:23 |
|
bitRAKE 14 Aug 2023, 19:05
Flier-Mate wrote: Compile with -s switch can save the binary executable size by 1KB. But -Os actually increase the size, not decrease it. _________________ ¯\(°_o)/¯ “languages are not safe - uses can be” Bjarne Stroustrup |
|||
14 Aug 2023, 19:05 |
|
AsmGuru62 14 Aug 2023, 22:31
Quote:
Weird. Visual Studio, which I have, has both of these options when I am building my "C" project. And if I look at disassembled codes -- they are different. |
|||
14 Aug 2023, 22:31 |
|
revolution 14 Aug 2023, 23:13
gcc also has debug and release options.
The inclusion of debug symbols is the most obvious difference with regard to size of the output. |
|||
14 Aug 2023, 23:13 |
|
Flier-Mate 15 Aug 2023, 10:15
bitRAKE wrote:
Maybe my compiler on disk is outdated, I got this error when trying to use -Oz: Code: boo@DESKTOP-1V5DHQJ:/mnt/c/Users/BOO/Projects$ gcc h.c -Oz -o h cc1: error: argument to ‘-O’ should be a non-negative integer, ‘g’, ‘s’ or ‘fast’ |
|||
15 Aug 2023, 10:15 |
|
Flier-Mate 15 Aug 2023, 10:16
AsmGuru62 wrote:
I didn't know VS can be used to compile C projects as well.... |
|||
15 Aug 2023, 10:16 |
|
Flier-Mate 15 Aug 2023, 10:16
revolution wrote: gcc also has debug and release options. Thank you for the correction. |
|||
15 Aug 2023, 10:16 |
|
revolution 15 Aug 2023, 10:22
Flier-Mate wrote: I didn't know VS can be used to compile C projects as well.... |
|||
15 Aug 2023, 10:22 |
|
Furs 15 Aug 2023, 12:35
Flier-Mate wrote: Compile with -s switch can save the binary executable size by 1KB. But -Os actually increase the size, not decrease it. You can also strip them after-the-fact with strip -s command line tool. |
|||
15 Aug 2023, 12:35 |
|
AsmGuru62 15 Aug 2023, 17:27
The size of debug symbols aside -- the Released version of code (assembly code) is smaller by some degree.
Register allocation and all that "dark art of optimization techniques". |
|||
15 Aug 2023, 17:27 |
|
Goto page Previous 1, 2, 3 < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.