Reduce indirections and allocations in event manager.
Needs RevisionPublic

Authored by andrewthad on Dec 20 2018, 9:44 AM.



Judiciously use bang patterns in the event manager to prevent needless
boxing. Remove several INLINE pragmas from massive functions. These
pragmas inhibited other optimizations and were not even beneficial at
call sites since the unfoldings were so large. Use evtNothing instead
of Nothing in threadWaitSTM, shaving off an indirection. Get rid of
INLINE pragma on registerFd.

andrewthad created this revision.Dec 20 2018, 9:44 AM

No one should bother looking at this. It is a work in progress, and I need to figure out a way to benchmark it. I don't know if there is already a benchmark out there that does a bunch of small stuff using the event manager and then measures allocations and time elapsed. There are also some places with boxed machine ints in callbacks that I want to change, but I have to finish UnliftedNewtypes to have a safe way to do this.

andrewthad updated this revision to Diff 19234.Dec 24 2018, 6:26 AM
  • more changes

@andrewthad, this looks like the beginnings of a nice patch. However, given that we haven't really started review yet do you suppose you could move this to GitLab when you would like review?

bgamari requested changes to this revision.Jan 20 2019, 6:39 PM
This revision now requires changes to proceed.Jan 20 2019, 6:39 PM

Certainly. This was just at attempt to write out some stuff I'd been musing about. I stuck it up here so that I couldn't accidentally delete it. If there's some kind of way to close a differential on phabricator so that you're able to see what's still being actively worked on, feel free to close this one.