import timeit

def re_remove(text):
    return shortword.sub('', text)

def lc_remove(text):
    return ' '.join(word for word in text.split() if len(word) > 3)
timeit.timeit('remove(" in the echo chamber from Ontario duo ")',
    'from __main__ import re_remove as remove')
Remove small words using Python