require inside of a function is better- its still blocking IO so doing it as needed is preferable to at the top of modules (in general). I am not always great about this but its faster.