Closed musaprg closed 3 months ago
There might be a downside to applying HashMap for manipulation, for example, inserting a new value could be slow. AFAIU, there are a few insertions in the current container_process_init function, so I don't think it would put the additional latency for the initialization process.
The improvements looks to be worth it. I would not be too concerned with the performance of insert with Hashmap vs. Array. For this specific usecase.
The environment variables
envs
for the container processes are obtained inVec<String>
and manipulated based on the various circumstances incontainer_init_process
^manipulate-envs-1. They're eventually converted into the HashMap, so the logic to manipulate environment variables should be performed for the parsed HashMap instead ofVec<String>
. It would reduce the conditional logic based on the string match^conditional-logic-code.There might be a downside to applying HashMap for manipulation, for example, inserting a new value could be slow. AFAIU, there are a few insertions in the current
container_process_init
function, so I don't think it would put the additional latency for the initialization process.