-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/topic/awelzel/few-more-microbenc…
…hmarks' * origin/topic/awelzel/few-more-microbenchmarks: microbenchmarks: Add record-ops/connection-create Update README.md / Makefile microbenchmarks: Add table-ops/create.zeek
- Loading branch information
Showing
5 changed files
with
76 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
ci-based/scripts/microbenchmarks/record-ops/connection-create.zeek
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
global n = 5000000; | ||
|
||
global ts = double_to_time(42.0); | ||
global history = "ShADafF"; | ||
global uid = "C23890741"; | ||
|
||
event zeek_init() | ||
{ | ||
local i = 0; | ||
local s = 0; | ||
while ( i < n ) | ||
{ | ||
local c: connection = connection( | ||
$start_time=ts, | ||
$duration=1sec, | ||
$history=history, | ||
$uid=uid, | ||
); | ||
c$orig = endpoint($size=i, $state=TCP_CLOSED, $flow_label=0); | ||
c$resp = endpoint($size=i*2, $state=TCP_CLOSED, $flow_label=0); | ||
c$tunnel = vector(); | ||
|
||
s += c$orig$size; | ||
s += c$resp$size; | ||
s += |c$service|; | ||
s += |c$tunnel|; | ||
|
||
++i; | ||
} | ||
|
||
print i, s; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
global tbl: table[count] of count; | ||
global tbl_nested: table[count, count] of table[count] of count; | ||
global n = 5000000; | ||
|
||
event zeek_init() | ||
{ | ||
local i = 0; | ||
local s = 0; | ||
while ( i < n ) | ||
{ | ||
tbl = table([i] = i); | ||
tbl_nested = table([i, i] = table([i] = i)); | ||
tbl_nested[s, s] = table([s] = s); | ||
s += (|tbl| + |tbl_nested|); | ||
++i; | ||
} | ||
|
||
print i, s; | ||
} |