I am working on a python script that basically uses very long mpz integers (from gmpy2 library) and some small lists. Apart from other typical "pythonic" code optimizations, I have tried to reduce the times required for the calculations inside the script (basically, they are "mul", "add", "sub" calculations from gmpy2) by using the set_cache function as well, but even setting it to the max, i.e. set_cache(1000,16384), I can not see any difference between using or not using it, the timings are the same ones for big integers.
If somebody has experience about the usage of get_cache or for which kind of operations is better to set it, I would appreciate some information. I just know what the official gmpy page says about it (very basic), and googling about that method in Internet does not provide any interesting samples (at least I did not find them yet)