Two things about the Python version: * Using `xrange` tells me you're on Python 2. I suggest you use a current/recent Python 3 version for your benchmarks. * The recommended way to concatenate a big number of strings is with `separator.join(iterable)`.
So you could use: `s = "".join(("x" for _ in range(100_000_000)))`, - but the Pythonic version would actually be `s = 100_000_000 * "x"`.