medic / cht-user-management

GNU Affero General Public License v3.0
3 stars 1 forks source link

Improve performance of parsing CSV files #144

Closed kennsippell closed 2 months ago

kennsippell commented 2 months ago

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 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

Narok DataSet Before: 44s After: 14s