Skip to content
This repository has been archived by the owner on Apr 11, 2024. It is now read-only.

[Question] How is "hot" code prevented? #47

Closed
tomByrer opened this issue Apr 30, 2013 · 1 comment
Closed

[Question] How is "hot" code prevented? #47

tomByrer opened this issue Apr 30, 2013 · 1 comment
Labels

Comments

@tomByrer
Copy link

I'm giving a 6 minute talk on jsPerf in a few days, & like to know how is "hot" code prevented. please? Seems that FireFox has several optimization layers, & I'd expect tight loops will make FF jump to optimize early.

From your talks I see you use several loops of different lengths, so my brief bullet points would be:

  • Minor prevention of "hot" code with variable-length loops
  • Sometimes best to test on larger chunks of real-world code than tiny isolated routines

Do you think this is fair/accurate please? BTW, I'm not saying to never test on tiny routines, but my ASM programming experience & lessons on ninja JS engine optimization tricks, indicates code context is important.

@jdalton
Copy link
Member

jdalton commented May 8, 2013

Hot code isn't prevented and really can't be. Benchmarking requires a test loop to meet the minimum time a test should run. However, we do try to keep each sample as free from previous samples hot code contamination. We do this by keeping variables, properties, values unique in each compiled test sample. We also work around various engine bugs in Firefox/Chrome.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

2 participants