-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hubble: let ServiceGetter.GetServiceByAddr return service by pointer
This avoids copying the Service protobuf object and improves performance and memory usage: name old time/op new time/op delta L34Decode-8 4.10µs ± 5% 3.63µs ± 8% -11.51% (p=0.000 n=10+10) name old alloc/op new alloc/op delta L34Decode-8 1.24kB ± 0% 1.03kB ± 0% -16.77% (p=0.000 n=10+10) name old allocs/op new allocs/op delta L34Decode-8 26.0 ± 0% 21.0 ± 0% -19.23% (p=0.000 n=10+10) name old time/op new time/op delta L7Decode-8 6.37µs ±11% 5.79µs ± 4% -9.02% (p=0.000 n=10+10) name old alloc/op new alloc/op delta L7Decode-8 1.53kB ± 0% 1.37kB ± 0% -10.47% (p=0.000 n=10+10) name old allocs/op new allocs/op delta L7Decode-8 36.0 ± 0% 34.0 ± 0% -5.56% (p=0.000 n=10+10) Also, the ok bool return is no longer necessary as callers can just check for a nil return value. This simplifies the logic in (*Parser).Decode a bit and avoids allocating an empty object for cases when no service is found. Signed-off-by: Tobias Klauser <tobias@cilium.io>
- Loading branch information
Showing
7 changed files
with
23 additions
and
31 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
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
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