Doing a quick profile during CSV parse, I'm seeing the majority of time is spent in axios.create. I'm not sure why, but when calling chtApi.chtSession, we are returning a clone of the session which recreates the object and creates an axios instance. With proper use of TypeScript, I think we don't need to fear an object overwriting any information on the session and the clone is not necessary.
After this change, the majority of time is spent in the validation library and in LiquidJs. That seems like a much better place to be. Obviously, performance isn't great and we can do more. Can look at this during https://github.com/medic/cht-user-management/issues/128
137
Doing a quick profile during CSV parse, I'm seeing the majority of time is spent in
axios.create
. I'm not sure why, but when callingchtApi.chtSession
, we are returning a clone of the session which recreates the object and creates an axios instance. With proper use of TypeScript, I think we don't need to fear an object overwriting any information on the session and the clone is not necessary.After this change, the majority of time is spent in the validation library and in LiquidJs. That seems like a much better place to be. Obviously, performance isn't great and we can do more. Can look at this during https://github.com/medic/cht-user-management/issues/128
Narok DataSet Before: 44s After: 14s