Running this code is a fantastic way to waste power/time/money/energy.
Random TF for this number is pointless. And trying to "optimise" a scripting language is equally pointless.
You need another method (not TF), and you need another language (not a scripting language).