OSC / ood-activejobs

[MOVED] Active Jobs provides details of scheduled jobs on an HPC cluster.
https://osc.github.io/Open-OnDemand/
MIT License
0 stars 1 forks source link

Consider minifying json response data keys. #91

Closed brianmcmichael closed 7 years ago

brianmcmichael commented 7 years ago

A json response currently looks like:

[{"pbsid":"8724294.oak-batch.osc.edu","jobname":"parallel_fluent","username":"osu0842","account":"PAS0228","status":"queued_held","cluster":"oakley","extended_available":true}]

By encoding these keys to a single char we can decrease the size of the response by 30% and speed up the wait while jobs download and parse, we could probably get a better than 30% speed improvement when you compound clientside processing. This would be a valuable UX improvement because there is a longish wait time when requesting "All Jobs"

The big downfall is that the code would be a little more difficult to read, which could be overcome by appropriate inline documentation and renaming them back to more user-friendly options once they arrive at client-side.

ericfranz commented 7 years ago

When using the Active Jobs app from Chrome, the request headers sent include:

Accept-Encoding:gzip, deflate, sdch, br

and the response headers include:

Content-Encoding:gzip

I don't think we will beat gzip.

brianmcmichael commented 7 years ago

You are right. The raw text is currently at 834 KB, but Chome says the download size is 37.2 KB, so it appears that the magic is already happening. Closing.

ericfranz commented 7 years ago

FWIW on the "Timing" tab on the ajax request in Chrome dev tools I see this:

screen shot 2017-03-29 at 3 37 12 pm

  1. Time to First Byte is 2.20 seconds
  2. Content Download time of gzipped data is 14.28ms

So the question there would be, where in the request is the most of the 2.20 seconds spent? https://www.skylight.io/ for Rails apps is amazing, but there are plenty of profiling options available.

brianmcmichael commented 7 years ago

Ok, the ajax request from datatables isn't fired until after $(document).ready(), so there's a good chance we're waiting for all of the other page components to load.

brianmcmichael commented 7 years ago

Nevermind, TTFB means we're waiting on the serverside. Got it.

ericfranz commented 7 years ago

Actually not sure about that.

See:

screen shot 2017-03-29 at 4 02 14 pm

we have 2 requests we respond slowly to:

  1. the initial request for the app root /pun/sys/activejobs

screen shot 2017-03-29 at 4 04 12 pm

  1. the ajax request for json qstat

screen shot 2017-03-29 at 4 04 19 pm

The rest of the requests total take half a second.