On Wed, Jun 25, 2008 at 1:16 AM, Dick Moores <[EMAIL PROTECTED]> wrote: > At 07:00 PM 6/24/2008, Marilyn Davis wrote: > >> Has anyone ever timed the difference between using a function that was >> imported with: >> >> from my_module import MyFunction >> >> and: >> >> import my_module > > Here are 2 comparisons: <http://py77.python.pastebin.com/f53ab3769>, and > <http://py77.python.pastebin.com/f68346b28> > > I don't see a significant difference.
I wouldn't expect much. The only difference is the extra attribute lookup in the second form. Attribute lookup is slow enough to be measurable and fast enough that you will only care if you are doing it a lot of times. Kent _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor