Commit 80d6d73
meshcontroller: improve service instance search performance in Master (#1503)
* meshcontroller: improve service instance search performance in Master
Replaced the O(N*M) nested loop in checkServiceInstances with an
O(N+M) map-based lookup. This significantly improves performance
when dealing with a large number of service instances.
The map uses a composite key consisting of ServiceName and InstanceID
to uniquely identify each instance status.
Co-authored-by: LokiWager <32408858+LokiWager@users.noreply.github.com>
* Update pkg/object/meshcontroller/master/master.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Co-authored-by: google-labs-jules[bot] <161369871+google-labs-jules[bot]@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>1 parent b21c3ee commit 80d6d73
1 file changed
+10
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
142 | 151 | | |
143 | 152 | | |
144 | 153 | | |
145 | 154 | | |
146 | 155 | | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
| 156 | + | |
154 | 157 | | |
155 | 158 | | |
156 | 159 | | |
| |||
0 commit comments