Skip to content

Conversation

@niaow
Copy link
Member

@niaow niaow commented Oct 17, 2019

This was a micro-optimization I worked on when messing around with #513. I later put it in #606.

Basically:

  1. When running scheduler-heavy code (in the original case a goroutine/channel benchmark), the scheduler gets bottlenecked by expensive calls to check the time on the system. This patch allows us to skip the check and get a massive improvement in performance.
  2. When a piece of code does not care about timing, sleepQueue != nil gets constant-folded to false and all of the timing code gets optimized away.

@niaow niaow requested a review from deadprogram October 17, 2019 22:01
Copy link
Member

@aykevl aykevl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great find!

@aykevl aykevl merged commit c4dff99 into tinygo-org:dev Oct 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants