-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Optimized marshaling of Go values into WAF values
The CPU profiler along with the new benchmark (agent side) allowed to spot every source of overhead. The new implementation adds: - requires at least go 1.12 which introduces reflect.Value.MapRange() which prevents using reflect.Value.MapKeys() that was creating a slice. Resulting in lots of overhead when large maps were traversed. - strings are now limited to 4kB. - remove every use of []byte(str) that in fact involve a copy of str into a new slice of bytes. - the WAF value constructors are rewritten in Go to avoid short back-and-forth C calls that were adding a lot of CGO overhead (mainly pointer checks). The benchmarks now gives a maximum time of 1ms.
- Loading branch information
Showing
8 changed files
with
296 additions
and
98 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/sqreen/go-libsqreen | ||
|
||
go 1.10 | ||
go 1.12 | ||
|
||
require ( | ||
github.com/pkg/errors v0.8.1 | ||
|
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.