Skip to content

Use dynamic dispatch for EventIO#10035

Merged
moonchen merged 4 commits intoapache:masterfrom
moonchen:eventio-dynamic-dispatch-rebase
Jul 31, 2023
Merged

Use dynamic dispatch for EventIO#10035
moonchen merged 4 commits intoapache:masterfrom
moonchen:eventio-dynamic-dispatch-rebase

Conversation

@moonchen
Copy link
Contributor

@moonchen moonchen commented Jul 13, 2023

Instead of using branches, use dynamic dispatch to process each EventIO. Mainly this helps with code organization, and untangles dependencies in iocore.

Testing shows dynamic dispatch to be no worse than branching (approximately 0.5% +- 0.2% better rps).

@moonchen moonchen force-pushed the eventio-dynamic-dispatch-rebase branch from 74c41c1 to 57533df Compare July 14, 2023 21:53
@moonchen moonchen force-pushed the eventio-dynamic-dispatch-rebase branch from 57533df to 8a6bf9a Compare July 17, 2023 20:22
@moonchen moonchen marked this pull request as draft July 17, 2023 20:57
@moonchen moonchen force-pushed the eventio-dynamic-dispatch-rebase branch from b6dee58 to 9294c6c Compare July 18, 2023 20:19
@moonchen
Copy link
Contributor Author

[approve ci clang-analyzer]

@moonchen
Copy link
Contributor Author

AuTests fixed by #10067

@moonchen moonchen marked this pull request as ready for review July 20, 2023 15:24
@moonchen moonchen requested a review from maskit July 24, 2023 20:28
@bryancall bryancall requested a review from ywkaras July 24, 2023 22:15
@@ -0,0 +1,38 @@
/** @file

A brief file description
Copy link
Contributor

Choose a reason for hiding this comment

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

Better to omit @file if no actual description:

@section license License

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

{
#if HAVE_EVENTFD
uint64_t counter;
ATS_UNUSED_RETURN(read(_fd, &counter, sizeof(uint64_t)));
Copy link
Contributor

Choose a reason for hiding this comment

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

I' d suggest instead:

static_cast<void>(read(_fd, &counter, sizeof(uint64_t)));

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@moonchen moonchen requested a review from ywkaras July 28, 2023 18:49
@moonchen moonchen merged commit 003e9ce into apache:master Jul 31, 2023
JosiahWI pushed a commit to JosiahWI/trafficserver that referenced this pull request Aug 3, 2023
Instead of using branches, use dynamic dispatch to process each EventIO. Mainly this helps with code organization, and untangles dependencies in iocore.

Testing shows dynamic dispatch to be no worse than branching (approximately 0.5% +- 0.2% better rps).
@zwoop zwoop added this to the 10.0.0 milestone Feb 29, 2024
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.

4 participants