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

bzip2-js decode #1

Merged
merged 4 commits into from
Nov 4, 2012
Merged

bzip2-js decode #1

merged 4 commits into from
Nov 4, 2012

Conversation

gbarco
Copy link

@gbarco gbarco commented Aug 3, 2012

Hi!

I have made some changed to your code, mostly regarding porting python functions to native Javascript and inlining functions that where used only once and eliminated some inheritance with the objective of reducing the download size for the library.

The final code is around 20% smaller when minified or minified and gzip from the original.

Be warned that I have run only simple tests, that is it just decompresses with no error some static input I fed. No extensive checks.

I share it with you just in case you might make good use of it.

Thanks a lot for this piece of code.

Best regards,
Gonzalo

…gle use functions.

Around 20% size reduction when minified with YUI and also when minified and gzipped (around 1,8KiB final download from 2,3Kib)
Missing a test suit...
@kirilloid
Copy link
Owner

Sorry, I have had much work and now go on vacation...
I'll look at request later in September.

@gbarco
Copy link
Author

gbarco commented Aug 24, 2012

No problem.
If you wish you can check out my fork. I continued to minimize the code.
It drifted a lot from the original code, mostly substituting what looked to
Pythony.
It can now be minified with YUI and gzipped in less than 1.5Kb.

Happy holidays!

Regards,
gonzalo

On Thu, Aug 23, 2012 at 5:04 PM, kirilloid notifications@github.com wrote:

Sorry, I have had much work and now go on vacation...
I'll look at request later in September.


Reply to this email directly or view it on GitHubhttps://github.com//pull/1#issuecomment-7982253.

@ku1ik
Copy link

ku1ik commented Aug 25, 2012

I used current version by @gbarco in http://ascii.io and it seems to be working fine.

kirilloid added a commit that referenced this pull request Nov 4, 2012
@kirilloid kirilloid merged commit a4a43a8 into kirilloid:master Nov 4, 2012
@kirilloid
Copy link
Owner

Finally I looked at it. You inlined/uninlined functions to achieve max. size reduction, but actually several hundreds of bytes hardly matter. When I inlined most functions, I did that for the sake of speed.

The function you uninlined may cost ~10% exec.speed, but need to test it on newer browsers. Auto-inlining by compiler should get improved since then.

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.

3 participants