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

[HTTP/2] BlocksQueue can probably be optimized #224

Open
c410-f3r opened this issue Sep 16, 2024 · 0 comments
Open

[HTTP/2] BlocksQueue can probably be optimized #224

c410-f3r opened this issue Sep 16, 2024 · 0 comments
Labels
enhancement The current state be improved F-http2 Feature - Http/2

Comments

@c410-f3r
Copy link
Owner

c410-f3r commented Sep 16, 2024

BlocksQueue is a fundamental CSR-inspired data structure for HpackHeaders and any optimization will likely benefit HTTP/2.

It is a circular buffer like VecDeque but instead of storing individual elements, it stores chunks of elements that are logically demarcated. Another important feature of BlocksQueue is the fact that chunks never intersect boundaries.

Three "push_front" operations. `H` means head.

// One block. First has 1 element
Buffer: [. . . . . H . .]

// Two blocks. First has 1 element and second has 3 elements
Buffer: [. . H * * * . .]

// Three blocks. First has 1 element, second has 3 elements and third has 3 elements
// To avoid an intersection, the buffer had to be increased with shifted elements.
Buffer: [. . H * * * * * *]

I am not totally sure but the implementation can probably be optimized to generate more efficient assembly, specially in the "push_front" method.

@c410-f3r c410-f3r added F-http2 Feature - Http/2 data structure and removed data structure labels Sep 16, 2024
@c410-f3r c410-f3r removed the C-wtx label Sep 29, 2024
@c410-f3r c410-f3r changed the title [HTTP/2] BlocksQueue can probably be optimized [HTTP/2] BlocksQueue can probably be optimized Sep 29, 2024
@c410-f3r c410-f3r added the enhancement The current state be improved label Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The current state be improved F-http2 Feature - Http/2
Projects
None yet
Development

No branches or pull requests

1 participant