Itamar Turner-Trauring on Nostr: npub1mjjwe…7h2pr For speed, the first answer is almost always another question: do ...
npub1mjjwe95dghhw434k4vsvxs5yl6gcr6kupghf5u0dgcvhga0w94sqe7h2pr (npub1mjj…h2pr) For speed, the first answer is almost always another question: do you have evidence that this is a bottleneck? If it's 1% of your program runtime, making it twice as fast won't make much of a difference...
If you have evidence that this part of the code is a bottleneck, easiest thing to do is just measure the two versions and compare. E.g. with %timeit magic in IPython/Jupyter: https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-timeit
If you have evidence that this part of the code is a bottleneck, easiest thing to do is just measure the two versions and compare. E.g. with %timeit magic in IPython/Jupyter: https://ipython.readthedocs.io/en/stable/interactive/magics.html#magic-timeit