On 12/06/12 07:37, Frank Rueter wrote:
hm, that subject line might get stuck in some people's spam filter. oh
well...
I am storing hundreds of struct_time objects in a fairly large
dictionary and am wondering if it would be wiser to convert those to a
floating point numbers via time.mktime() first for efficiency?! The
dictionary is representing database content so it may grow a lot larger
in the future, which is why I'm keen to be efficient now rather than fix
things later.
I don't know if this is completely relevant, but if the python functions
map to the standard system ones, I've found in the past that the
mktime() and localtime() C functions are quite costly if used a lot (in
terms of CPU usage) on both Linux and OS X, so you probably want to only
call them once for each time item if speed is your primary concern...
Peter
--
Peter Pearson, Software Engineer
The Foundry, 6th Floor, The Communications Building,
48 Leicester Square, London, UK, WC2H 7LT
Tel: +44 (0)20 7434 0449 Web: www.thefoundry.co.uk
The Foundry Visionmongers Ltd.
Registered in England and Wales No: 4642027
_______________________________________________
Nuke-python mailing list
Nuke-python@support.thefoundry.co.uk, http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-python