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

Add strip option in qjsc to reduce object size #388

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

chqrlie
Copy link
Collaborator

@chqrlie chqrlie commented Apr 18, 2024

  • -s strips the source code
  • -ss strips source and line/column numbers information
  • qjsc repl.js generates an object size of 105726 bytes
  • qjsc -s repl.js generates an object size of 20853 bytes
  • qjsc -ss repl.js generates an object size of only 16147 bytes
  • compile repl.js with -ss
  • bump byte code version to 12

This also greatly reduces the repository inflation rate due to the generated code in gen.

- `-s` strips the source code
- `-ss` strips source and line/column numbers information
- `qjsc repl.js` generates an object size of **105726** bytes
- `qjsc -s repl.js` generates an object size of **20853** bytes
- `qjsc -ss repl.js` generates an object size of only **16147** bytes
- compile repl.js with `-ss`
- bump byte code version to 12
Copy link
Contributor

@saghul saghul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I like that it's similar to use strip but without less support from the runtime.

@chqrlie chqrlie merged commit f326a7a into quickjs-ng:master Apr 19, 2024
47 checks passed
@chqrlie chqrlie deleted the add-strip-option branch April 19, 2024 15:17
TooTallNate added a commit to TooTallNate/quickjs-ng that referenced this pull request Jul 3, 2024
The `-s` flag added in quickjs-ng#388 was missing in the `-h` help output.
saghul pushed a commit that referenced this pull request Jul 3, 2024
The `-s` flag added in #388 was missing in the `-h` help output.
andrjohns pushed a commit to andrjohns/quickjs-ng that referenced this pull request Jul 7, 2024
The `-s` flag added in quickjs-ng#388 was missing in the `-h` help output.
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

Successfully merging this pull request may close these issues.

None yet

2 participants