network: Optimize IsTLSEnabled() #1054

Merged
fyrchik merged 1 commits from fyrchik/frostfs-node:fix-network into master 2024-03-22 13:55:08 +00:00

No big deal, but it is called multiple times in sorting routine, this
easily results in 20 allocations per group traversal.

goos: linux
goarch: amd64
pkg: git.frostfs.info/TrueCloudLab/frostfs-node/pkg/network
cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz
                    │     old     │                 new                 │
                    │   sec/op    │   sec/op     vs base                │
AddressTLSEnabled-8   184.6n ± 1%   103.3n ± 6%  -44.04% (p=0.000 n=10)

                    │    old     │                new                │
                    │    B/op    │   B/op    vs base                 │
AddressTLSEnabled-8   704.0 ± 0%   0.0 ± 0%  -100.00% (p=0.000 n=10)

                    │    old     │                 new                 │
                    │ allocs/op  │ allocs/op   vs base                 │
AddressTLSEnabled-8   1.000 ± 0%   0.000 ± 0%  -100.00% (p=0.000 n=10)

Signed-off-by: Evgenii Stratonikov e.stratonikov@yadro.com

No big deal, but it is called multiple times in sorting routine, this easily results in 20 allocations per group traversal. ``` goos: linux goarch: amd64 pkg: git.frostfs.info/TrueCloudLab/frostfs-node/pkg/network cpu: 11th Gen Intel(R) Core(TM) i5-1135G7 @ 2.40GHz │ old │ new │ │ sec/op │ sec/op vs base │ AddressTLSEnabled-8 184.6n ± 1% 103.3n ± 6% -44.04% (p=0.000 n=10) │ old │ new │ │ B/op │ B/op vs base │ AddressTLSEnabled-8 704.0 ± 0% 0.0 ± 0% -100.00% (p=0.000 n=10) │ old │ new │ │ allocs/op │ allocs/op vs base │ AddressTLSEnabled-8 1.000 ± 0% 0.000 ± 0% -100.00% (p=0.000 n=10) ``` Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
fyrchik requested review from storage-core-committers 2024-03-21 15:48:45 +00:00
fyrchik requested review from storage-core-developers 2024-03-21 15:48:47 +00:00
fyrchik force-pushed fix-network from 321b8d6769 to c7a12ca3d8 2024-03-21 15:48:51 +00:00 Compare
dstepanov-yadro approved these changes 2024-03-21 15:55:28 +00:00
aarifullin approved these changes 2024-03-22 11:26:43 +00:00
acid-ant approved these changes 2024-03-22 11:36:46 +00:00
achuprov approved these changes 2024-03-22 12:29:07 +00:00
fyrchik merged commit c7a12ca3d8 into master 2024-03-22 13:55:08 +00:00
fyrchik deleted branch fix-network 2024-03-22 13:55:08 +00:00
Sign in to join this conversation.
No Milestone
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#1054
There is no content yet.