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

Controls for granular benchmarking #56

Open
reem opened this issue Sep 23, 2014 · 14 comments
Open

Controls for granular benchmarking #56

reem opened this issue Sep 23, 2014 · 14 comments
Labels
A-client Area: client. A-server Area: server. B-rfc Blocked: More comments would be useful in determine next steps.

Comments

@reem
Copy link
Contributor

reem commented Sep 23, 2014

Downstream libraries should be able to easily profile requests.

@reem reem added A-server Area: server. A-client Area: client. servo labels Sep 23, 2014
@reem reem added this to the servo milestone Sep 23, 2014
@seanmonstar
Copy link
Member

Which pieces are desired?

  • DNS time?
  • Connect time
  • Write time
  • Read time

@reem
Copy link
Contributor Author

reem commented Sep 25, 2014

Probably all of those in addition to how long hyper itself takes for things like parsing.

On Wed, Sep 24, 2014 at 8:35 PM, Sean McArthur [email protected]
wrote:

Which pieces are desired?

  • DNS time?
  • Connect time
  • Write time

- Read time

Reply to this email directly or view it on GitHub:
#56 (comment)

@jdm
Copy link

jdm commented Sep 25, 2014

I think we want the ability to measure all of the applicable properties in https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/NavigationTiming/Overview.html .

@seanmonstar
Copy link
Member

For reference:

interface PerformanceTiming {
  readonly attribute unsigned long long navigationStart;
  readonly attribute unsigned long long unloadEventStart;
  readonly attribute unsigned long long unloadEventEnd;
  readonly attribute unsigned long long redirectStart;
  readonly attribute unsigned long long redirectEnd;
  readonly attribute unsigned long long fetchStart;
  readonly attribute unsigned long long domainLookupStart;
  readonly attribute unsigned long long domainLookupEnd;
  readonly attribute unsigned long long connectStart;
  readonly attribute unsigned long long connectEnd;
  readonly attribute unsigned long long secureConnectionStart;
  readonly attribute unsigned long long requestStart;
  readonly attribute unsigned long long responseStart;
  readonly attribute unsigned long long responseEnd;
  readonly attribute unsigned long long domLoading;
  readonly attribute unsigned long long domInteractive;
  readonly attribute unsigned long long domContentLoadedEventStart;
  readonly attribute unsigned long long domContentLoadedEventEnd;
  readonly attribute unsigned long long domComplete;
  readonly attribute unsigned long long loadEventStart;
  readonly attribute unsigned long long loadEventEnd;
};

@seanmonstar
Copy link
Member

I imagine checking the clock several times when you don't want it would cause slow down. I'm thinking these could be events that can receive closures to echoed anything. By default, there's no closure. So you only pay for what you use.

@znewman01
Copy link

For reference, my simple benchmark of time::precise_time_ns gives an average of 24ns per invocation:

extern crate test;
extern crate time;

use test::Bencher;

#[bench]
fn bench_precise_time_ns(b: &mut Bencher) {
    b.iter(|| time::precise_time_ns());
}

On my computer, the Hyper benchmark is 137,963ns, ±63387ns. So you'd have to check the clock 50 times to see a 1% increase. Is that acceptably low enough to do on each invocation (there are 21 timings listed in the W3C document, but several of them seem to be irrelevant (e.g. the DOM-related timings))?

Of course, it makes sense to answer this question by taking real benchmarks of the timing code in Hyper, but that was slightly more work 😃

@znewman01
Copy link

I'm interested because I'd like to implement HTTP archive output for Servo, which depends to an extent on being able to pull this information out of Hyper.

If nobody works on this issue before I finish up the other parts of that task, I'd be interested on taking it on. But in the meantime, anyone else should feel free to claim it.

@seanmonstar
Copy link
Member

Oh, that's not much time. I thought at some point someone told me that getting the date for the date header was showing up in profiles.

@znewman01
Copy link

Similar benchmarks show time::now_utc() at around 75ns.

Perhaps it's the actual formatting step that's taking longer. That part would pretty easy to do only as-demanded.

@seanmonstar seanmonstar removed this from the servo milestone Apr 2, 2015
@EliSnow
Copy link

EliSnow commented Apr 2, 2016

I would love to use hyper for HTTP load testing and would want these metrics as part of the results

@teburd
Copy link
Contributor

teburd commented May 25, 2016

Closures or a Trait impl, a Trait impl might be nicer if your doing something like sending off the metrics gathered to another metrics recorder service

@ChrisMacNaughton
Copy link

I would love to be able to get access to more granular timing information as well for a project I'm working on.

@seanmonstar seanmonstar removed the servo label Jan 20, 2017
@seanmonstar seanmonstar added the B-rfc Blocked: More comments would be useful in determine next steps. label May 10, 2018
@EliSnow
Copy link

EliSnow commented Dec 20, 2018

I believe the Tokio Trace proposal is relevant here.

@lneicelis
Copy link

Any update on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-client Area: client. A-server Area: server. B-rfc Blocked: More comments would be useful in determine next steps.
Projects
None yet
Development

No branches or pull requests

8 participants