optimize globals() dict