COM Server data from python


S

schapman1974

I am attempting to provide a bit of data through a com server I did a comparison of speed of my COM interface to ADODB and It seems massively slower.. I'm not sure if there is something I need to adjust or maybe that I am making so many calls to the COM server that each call takes time and possibly ADO is just buffering some data in chunks to my code. This is mainly foran excel add-on that has not possibility to connect to mongodb except through an interface like this.

I thought it was not really a big deal until I tested larger amounts of data and the speed took a nose dive. For instance 10,000 records just to walk through and pull a couple fields. ADO on the exact same data took only 1.5 seconds where my python code took close to 58 seconds to do the same thing. I've played around with design etc.

When i test the same code directly from python I get the same result if not better than I did with ADO. Is there some bit of COM magic that I am missing. Or is this because python is having to do more behind the scenes?

Thanks
 
Ad

Advertisements

C

Chris Farrow

I am attempting to provide a bit of data through a com server I did a comparison of speed of my COM interface to ADODB and It seems massively slower.. I'm not sure if there is something I need to adjust or maybe that I am making so many calls to the COM server that each call takes time and possibly ADO is just buffering some data in chunks to my code. This is mainly foran excel add-on that has not possibility to connect to mongodb except through an interface like this.



I thought it was not really a big deal until I tested larger amounts ofdata and the speed took a nose dive. For instance 10,000 records just to walk through and pull a couple fields. ADO on the exact same data took only 1.5 seconds where my python code took close to 58 seconds to do the same thing. I've played around with design etc.



When i test the same code directly from python I get the same result ifnot better than I did with ADO. Is there some bit of COM magic that I am missing. Or is this because python is having to do more behind the scenes?



Thanks

Hi,

Did you implement your server using win32com? You might be better off looking for help on the python-win32 mailing list [1].

Regards,

Chris

[1] https://mail.python.org/pipermail/python-win32/
 

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

Top