-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make (declare (not poll-on-return)) the default
- Loading branch information
Showing
3 changed files
with
6,684 additions
and
7,505 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Oops, something went wrong.
dfe0b57
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious, did this make a measurable difference in benchmark times?
dfe0b57
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On some benchmarks yes. A more detailed analysis will have to wait for the CPU backend when we have more control over the generated machine code.
dfe0b57
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the effect of this on the semantics of code?
dfe0b57
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the (not poll-on-return) the polling interval is no longer bound by a constant. I haven't done an in-depth analysis, but I believe that in practice it will have a small effect on the average polling latency.
dfe0b57
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a test:
which results
This is on
with
and
dfe0b57
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You aren't measuring what you think you are measuring... this is measuring GC time... your first measurement of poll-on-return is growing the heap to a large size to accommodate the 10 million stack frames... this causes lots of GCs... the second measurement just cruises along because the heap is already very large.
dfe0b57
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK. Here are times with a 1GB minimum heap.
I thought the call/return cpu times looked big.
dfe0b57
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to measure the overhead, use a small n (say around 100 to 1000) and loop that many times. That way the stack overflow and underflow handling will be factored out. And run for >= 1 sec please.
dfe0b57
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be easier for me if you just told me all the things I'd have to look out for at once.
Let's try:
which leads to
If I make the inner loop 1000, then there's almost no difference:
dfe0b57
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As I said a more detailed analysis will have to wait for the CPU backend when we have more control over the generated machine code. With the C backend it is hard to draw any conclusions as the C compiler's optimizations cause interference.