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

Separate very slow pygments colorizing from JSON indentation #59

Closed
acdha opened this issue Jul 2, 2012 · 2 comments
Closed

Separate very slow pygments colorizing from JSON indentation #59

acdha opened this issue Jul 2, 2012 · 2 comments
Labels
enhancement New feature or enhancement

Comments

@acdha
Copy link

acdha commented Jul 2, 2012

The Pygments JSON colorization is nice but noticeably slow. I would love to have separate --indent and --colorize options rather than simply --ugly which would be equivalent to http URL | python -m json.tool, which appears to be 3-4 times faster in my testing.

@jkbrzt
Copy link
Member

jkbrzt commented Jul 2, 2012

Approximately how large are the responses where the delay is noticeable?

I've tried to compare the following a couple of times:

time http GET https://api.github.com/repos/jkbr/httpie/watchers

Vs.:

time http --ugly GET https://api.github.com/repos/jkbr/httpie/watchers

And haven't noticed any difference.

It would be great if you could post some numbers on the rendering speed vs. response size with the relevant URLs (if possible).

@acdha
Copy link
Author

acdha commented Jul 3, 2012

They are somewhat large - currently around 224KB uncompressed:

cadams@Io:~ $ time -p http --ugly http://www.wdl.org/en/api/v1/region/ > /dev/null
real 0.52
user 0.37
sys 0.07
cadams@Io:~ $ time -p http --pretty http://www.wdl.org/en/api/v1/region/ > /dev/null
real 4.09
user 3.86
sys 0.13

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or enhancement
Projects
None yet
Development

No branches or pull requests

2 participants