473,326 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Faster copying of composite new-class objects

Hi,

My program requires copying thousands of composite new-class objects. I
found that the following: objCopy=cPickle.loads(cPickle.dumps(obj,
protocol=2)) works about 4 times faster than
copyObj=copy.deepcopy(obj). Is there any way to do it even faster?

All objects have slots, __getstate__ and __setstate__.

TIA,

Alex

Dec 17 '05 #1
1 1004
"Alex" <Ou****@gmail.com> writes:
My program requires copying thousands of composite new-class objects. I
found that the following: objCopy=cPickle.loads(cPickle.dumps(obj,
protocol=2)) works about 4 times faster than
copyObj=copy.deepcopy(obj). Is there any way to do it even faster?

All objects have slots, __getstate__ and __setstate__.


At a wild guess: writing custom serialisation functions using module
marshal?
John

Dec 22 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: rufus | last post by:
Hi, I was wondering how a DataGrid can handle a DataSet with a composite key. How would I update 1 row in a database having a composite key? A possible solution would be to concatenate my...
11
by: JerryJ | last post by:
I have to fetch values from a database and store them in a vector in my c++ application. What is faster? if i fetch the values sorted from the database with a 'order by' clause in the...
6
by: Matan Nassau | last post by:
Hello. i have a composite which i want to delete. this is a composite which represents a boolean expression (see a previous post of mine with more details at...
98
by: jrefactors | last post by:
I heard people saying prefix increment is faster than postfix incerement, but I don't know what's the difference. They both are i = i+1. i++ ++i Please advise. thanks!!
2
by: Harry | last post by:
Hello, I have a composite WebControl that I'm dynamically instantiating at runtime using Reflection. When I create a new instance of my control I immediately iterate through it's child control...
1
by: eric dugal | last post by:
Hi!! I just want to create a composite control derived from a datagrid and a one or more button on top of the grid in a table. I already tried to put my button on the createchildrenControls...
2
by: Skwerl | last post by:
We just installed a new SAN from Sun and need to migrate several terrabytes over to it from our Windows servers. We've found that drag-and-drop copying files using Explorer is going to be very...
11
by: akarui.tomodachi | last post by:
I have two structure definitions as below: typedef struct _sourceString { char firstSourceString; char secondSourceString; char thirdSourceString; }sourceString;
16
by: Jon Davis | last post by:
We ordered new systems with fast hardware and great specs, but Visual Studio takes longer to build a project than on the old workstation. Msbuild is faster, csc.exe is faster, file copy is faster....
2
by: lfhenry | last post by:
Hi All, I am about to make some changes to a process we have. The new process will have a new table who's job it is to store temporarily data such as customer, clerkno,productno, storeno , amount,...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.