Merge ClientIp with Headers. #1703

Closed
opened 2026-04-06 02:15:22 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @BlackDex on 3/11/2023

Since we now use the ClientIp Guard on a lot more places, it also increases the size of binary, and the macro generated code because of this extra Guard. By merging the ClientIp Guard with the several Header guards we have it reduces the amount of code generated (including LLVM IR), but also a small speedup in build time.

I also spotted some small json!() optimizations which also reduced the amount of code generated.

There was no decrease in the speed of the code as far as i could tell. It btw also lowered the amount of allocations done.

*Originally created by @BlackDex on 3/11/2023* Since we now use the `ClientIp` Guard on a lot more places, it also increases the size of binary, and the macro generated code because of this extra Guard. By merging the `ClientIp` Guard with the several `Header` guards we have it reduces the amount of code generated (including LLVM IR), but also a small speedup in build time. I also spotted some small `json!()` optimizations which also reduced the amount of code generated. There was no decrease in the speed of the code as far as i could tell. It btw also lowered the amount of allocations done.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/vaultwarden#1703