Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Size discussion #30

Closed
suntong opened this issue Aug 5, 2024 · 2 comments
Closed

Size discussion #30

suntong opened this issue Aug 5, 2024 · 2 comments

Comments

@suntong
Copy link

suntong commented Aug 5, 2024

Hi,

I tested with a relatively small one of my shell script, which is only ~ 1.3k in size (1323).

The generated file is nearly 70k (68384). In comparison, the shc generated file is about 20k (21120).

This somewhat surprises me, as the shc generated file is a standalone one that can be executed by itself, yet the ssc generated one still needs an interpreter.

I know people would say that disk space is nothing, but I'm just wondering why there's such huge differences between the two. thanks.

UPDATE:

Tried a normal-sized of my script, close to 30k (29906), and the size different is less than doubled (58704 vs 97064), just FTA.

@liberize
Copy link
Owner

liberize commented Aug 6, 2024

As far as I know, shc needs an interpreter at runtime too, whileas ssc can generate actually standalone binary with -e/-E flags.

The output binary size = main program size + script payload size. The size of main program is always the same. ssc is written in C++ and links against STL, it's generated main program size is expected to be larger.

Anyway, why does several kBs matter?

@suntong
Copy link
Author

suntong commented Aug 6, 2024

Oh, thanks. I was wondering why, just my curiosity.

@suntong suntong closed this as completed Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants