perl -wE 'for (1..10000) { print int(rand 2) ? "xyzabcd" : ("mul(" . int(rand 5000). "," . int(rand 5000) . ")" ) ; print "\n" unless int rand 10 }' > 1 #### time python3 1.py 1 Found 200 matches. real 0m0.027s user 0m0.018s sys 0m0.005s $ time 1.pl 1 Found 200 matches. real 0m0.006s user 0m0.004s sys 0m0.000s