fork(1) download
  1.  
  2. import time
  3.  
  4. matches = {"Foo", "Bar"}
  5. start = time.time()
  6. for x in xrange(1000000):
  7. name = "This String is Foo Bar"
  8. for s in matches:
  9. name = name.replace(s, "")
  10. print time.time() - start
Success #stdin #stdout 1.47s 7856KB
stdin
Standard input is empty
stdout
1.45389199257