mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
Reorder some class variables to fill in gaps in structure packing
The big hitters: Dict: Fills in four 4-byte holes in the structure. This shrinks Dictionary from 136 bytes to 114 bytes. Desc: Fills in a 6-byte hole in the structure. This shrinks ODesc from 152 bytes to 144 bytes. Frame: Moves and combines 4 bool variables from a few places into one single 4-byte block. This resolves all of the holes at once. This shrinks Frame from 216 bytes to 192 bytes and removes one cache line. Func: Moves one int32_t variable to fill in a 4-byte hole. This shrinks Func from 112 bytes to 104 bytes. ID: Moves two bool variables to fill in a 3-byte hole. This leaves behind a 1-byte hole, but removes a 6-byte pad from the end of the structure. This shrinks ID from 144 bytes to 136 bytes. Other changes: RuleHdrTest: Fills in one 4-byte hole in the structure. This shrinks RuleHdrTest from 248 bytes to 240 bytes. RuleEndpointState: Moves one bool variable down in the structure to reduce a 7-byte hole. This unfortunately causes a 3-byte hole later in the structure but there’s no easy way to filll it in. This does shrink RuleEndpointState from 128 bytes to 120 bytes though. ScannedFile: Moves two bool values to reduce a 4-byte hole by 2 bytes. This shrinks ScannedFile from 64 bytes to 56 bytes. Brofiler: Moves one char value to reduce a 4-byte hole by 1 byte. This shrinks Brofiler from 96 bytes to 88 bytes and removes one cache line. DbgBreakpoint: Moves some values around to fill in a 4-byte hole and reduce a second. A 2-byte hole still exists, but the structure shrinks from 632 bytes to 624 bytes. It’s possible on this one that one of the int32_t values could be an int16_t and remove the last 2-byte gap. ParseLocationRec: Moves one int to fill in a 4-byte hole. This shrinks ParseLocationRec from 32 bytes to 24 bytes. DebugCmdInfo: Moves one bool variable to shift a few others up. This results in a 6-byte pad at the end of the structure but removes a 7-byte hole in the middle. This shrinks DebugCmdInfo from 56 bytes to 48 bytes. FragReassembler: Moves one variable down to fill in a 4-byte hole. This shrinks FragReassembler from 272 bytes to 264 bytes. nb_dns_result: Moves ones uint32_t variable to fill in a 4-byte hole, also removing a 4-byte pad from the end of the structure. This shrinks nb_dns_result from 32 bytes to 24 bytes. nb_dns_entry: Moves one short value to fill in a 2-byte hole, also removing a 6-byte hole. This shrinks nb_dns_entry from 1064 bytes to 1056 bytes.
This commit is contained in:
parent
e66148a13a
commit
2964093e5d
16 changed files with 45 additions and 43 deletions
10
src/Frame.h
10
src/Frame.h
|
@ -261,6 +261,11 @@ private:
|
|||
/** The number of vals that can be stored in this frame. */
|
||||
int size;
|
||||
|
||||
bool weak_closure_ref = false;
|
||||
bool break_before_next_stmt;
|
||||
bool break_on_return;
|
||||
bool delayed;
|
||||
|
||||
/** Associates ID's offsets with values. */
|
||||
Val** frame;
|
||||
|
||||
|
@ -270,7 +275,6 @@ private:
|
|||
|
||||
/** The enclosing frame of this frame. */
|
||||
Frame* closure;
|
||||
bool weak_closure_ref = false;
|
||||
|
||||
/** ID's used in this frame from the enclosing frame. */
|
||||
id_list outer_ids;
|
||||
|
@ -289,12 +293,8 @@ private:
|
|||
/** The next statement to be evaluted in the context of this frame. */
|
||||
Stmt* next_stmt;
|
||||
|
||||
bool break_before_next_stmt;
|
||||
bool break_on_return;
|
||||
|
||||
IntrusivePtr<trigger::Trigger> trigger;
|
||||
const CallExpr* call;
|
||||
bool delayed;
|
||||
|
||||
std::vector<BroFunc*> functions_with_closure_frame_reference;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue