mirror of
https://github.com/status-im/consul.git
synced 2025-01-09 21:35:52 +00:00
e6b55d1d81
Replaces the reflection-based implementation of proxycfg's ConfigSnapshot.Clone with code generated by deep-copy. While load testing server-based xDS (for consul-dataplane) we discovered this method is extremely expensive. The ConfigSnapshot struct, directly or indirectly, contains a copy of many of the structs in the agent/structs package, which creates a large graph for copystructure.Copy to traverse at runtime, on every proxy reconfiguration.
18 lines
479 B
Bash
Executable File
18 lines
479 B
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
readonly PACKAGE_DIR="$(dirname "${BASH_SOURCE[0]}")"
|
|
cd $PACKAGE_DIR
|
|
|
|
# Uses: https://github.com/globusdigital/deep-copy
|
|
deep-copy -pointer-receiver \
|
|
-o ./proxycfg.deepcopy.go \
|
|
-type ConfigSnapshot \
|
|
-type ConfigSnapshotUpstreams \
|
|
-type PeerServersValue \
|
|
-type PeeringServiceValue \
|
|
-type configSnapshotConnectProxy \
|
|
-type configSnapshotIngressGateway \
|
|
-type configSnapshotMeshGateway \
|
|
-type configSnapshotTerminatingGateway \
|
|
./
|