- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 33.7k
 
benchmark: pre-optimize url.parse() before start #132
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
          
     Merged
      
      
            bnoordhuis
  merged 1 commit into
  nodejs:v0.12
from
bnoordhuis:optimize-on-next-function-call
  
      
      
   
  Dec 19, 2014 
      
    
                
     Merged
            
            benchmark: pre-optimize url.parse() before start #132
                    bnoordhuis
  merged 1 commit into
  nodejs:v0.12
from
bnoordhuis:optimize-on-next-function-call
  
      
      
   
  Dec 19, 2014 
              
            Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    | 
           Huh, sorry hit cmd+enter earlier than I thought. I thought there was a downside in not feeding enough type info, but I see now that you already incorporated this into this PR.  | 
    
| 
           LGTM  | 
    
Force V8 to optimize url.parse() before starting the actual benchmark. Tries to minimize variance between successive runs caused by the optimizer kicking in at different points. It does not seem to have much impact, CPU times are roughly the same before and afterwards; url.parse() quickly plateaus at a local optimum where most time is spent in V8 builtins, notably Runtime_StringSplit() and Object::GetElementWithReceiver() calls originating from deps/v8/src/uri.js, with no recurring optimize/deoptimize cycles that I could spot. Still, I don't see any downsides to pre-optimizing the function being benchmarked so in it goes. PR-URL: nodejs#132 Reviewed-By: Chris Dickinson <christopher.s.dickinson@gmail.com> Reviewed-By: Fedor Indutny <fedor@indutny.com>
d5cc52e    to
    1a63b45      
    Compare
  
    
    
  kunalspathak 
      referenced
      this pull request
        in nodejs/node-chakracore
    
      Dec 7, 2015 
    
    
      
  
    
      
    
  
Issue #132 is fixed in chakracore so adding back the jslint rule of prefer-const.
  This was referenced Jan 31, 2020 
      
  This was referenced Sep 27, 2021 
      
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Force V8 to optimize url.parse() before starting the actual benchmark.
Tries to minimize variance between successive runs caused by the
optimizer kicking in at different points.
It does not seem to have much impact, CPU times are roughly the same
before and afterwards; url.parse() quickly plateaus at a local optimum
where most time is spent in V8 builtins, notably Runtime_StringSplit()
and Object::GetElementWithReceiver() calls originating from
deps/v8/src/uri.js, with no recurring optimize/deoptimize cycles that
I could spot.
Still, I don't see any downsides to pre-optimizing the function being
benchmarked so in it goes.
R=@chrisdickinson. Please ignore the first commit, that's #131 (which is a prerequisite of this PR, however.)