fast deep-copying of instances

M

Michal Vitecek

hello,

i have a data cache which sits between a slow database and my server and
it's used to cache data retrieved from the database. in order for it to
work correctly (race-conditions) i need a fast deep-copying of
instances (the cache is used heavily).

i tried to use copy module but it's *very* slow, then i tried cPickle
to pickle and depickle instances which was faster, but still slow.

then i've come across cCopy which is 8x faster than copy, but
unfortunately it doesn't work with new style classes because type()'s
return is crappy for them. so the question is: does there exist a fast
copy module which works with new style classes?

thank you,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,576
Members
45,054
Latest member
LucyCarper

Latest Threads

Top