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

feat(chain): use nextTick instead of setImmediate #1808

Merged
merged 1 commit into from Dec 2, 2019

Commits on Nov 25, 2019

  1. feat(chain): use nextTick instead of setImmediate

    BREAKING CHANGE: Using setImmediate has more overhead than nextTick on
    Node.js v12. Benchmarks show improvements of >20% when changing
    setImmediate to nextTick:
    
      response-json throughput:
      {
          "significant": "***",
          "equal": false,
          "wins": "head",
          "diff": "28.62%"
      }
    
      ---- response-text ----
      ✔ Results saved for head/response-text
      ✔ Results saved for stable/response-text
      response-text throughput:
      {
          "significant": "***",
          "equal": false,
          "wins": "head",
          "diff": "43.45%"
      }
    
      ---- router-heavy ----
      ✔ Results saved for head/router-heavy
      ✔ Results saved for stable/router-heavy
      router-heavy throughput:
      {
          "significant": "***",
          "equal": false,
          "wins": "head",
          "diff": "30.02%"
      }
    
      ---- middleware ----
      ✔ Results saved for head/middleware
      ✔ Results saved for stable/middleware
      middleware throughput:
      {
          "significant": "***",
          "equal": false,
          "wins": "head",
          "diff": "20.78%"
      }
    
    This changes the order some events are processed (nextTick is processed
    earlier than setImmediate), thus this can be considered a breaking
    change as some edge cases will notice this (as we can see in the test
    changes).
    mmarchini committed Nov 25, 2019
    Copy the full SHA
    e40859c View commit details
    Browse the repository at this point in the history