How to improve extracting data speed

Peter Hickman peter at semantico.com
Wed Oct 6 10:49:27 EDT 2004


Yong Wang wrote:
> Hi, All:
>     I have a program in C language to extract data from binary file. Is there any way 
> I can use python to improve extract speed beause binary file is extreme large ?
>     Thank you all for inputs.
> 
>      Yong
> 

It rather depends on what you are doing with the data. Python ultimately will 
have to make exactly the same calls to the open and read functions that C does 
and as such it can be no faster than the system calls. If you are doing anything 
special with the data then perhaps Python can help with that to speed things up.

If your C program has a good algorithm to extract the data from the binary file 
then you are probably going to use much the same algorithm in Python, however 
Python may help with the data structures and how you process the data after you 
read it in.



More information about the Python-list mailing list