Optimize in which direction? Readability, speed, memory? Towards generalization or modularization?
01/07/2022, 11:21 AM
@Matteo Mirk thanks for replying me. I think Speed with memory efficent
01/07/2022, 11:27 AM
Then you would need to write a benchmark for this code an measure the hot points, then you can decide where to intervene. Performance optimization can’t be done blindly just reading the code (apart from some well-known optimization patterns). It also depends on your scenario and usages. Keep in mind that often you can’t push optimization too far towards speed AND memory: in many scenarios those vectors are orthogonal.