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

String delimiter : free one quote to use as token #61

Open
Siorki opened this issue Dec 28, 2016 · 0 comments
Open

String delimiter : free one quote to use as token #61

Siorki opened this issue Dec 28, 2016 · 0 comments

Comments

@Siorki
Copy link
Owner

Siorki commented Dec 28, 2016

The current implementation for #55 mostly focuses on finding the delimiter for the packed string that will yield the shortest preprocessed string, changing string quotes inside the code accordingly.

However, the shortest preprocessed string may not yield the shortest packed string.
An alternate route is to refactor all strings within the code so that they all have the same delimiter. When possible, this may incur extra escapes, but will yield one extra token for compression. Among the three quote symbols : ', " and `, :

  • one will be used for the strings inside the code
  • one will wrapping the packed string
  • one can be used as an extra token for compression
    This may be worthwhile or not. Depending on the input, there may be leftover tokens (so one extra will bring nothing), or an extra token will achieve another round of compression, worth anything from 1 to many bytes.

As this may not be obvious upon preprocessing, the existing algorithm and the solution described above should be processed as two separate branches (performing packing independently on both, then keeping only the best result) the same way as context hashing.

@Siorki Siorki changed the title String delimiter : free one token String delimiter : free one quote to use as token Dec 28, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant