[Tutor] Memory usage (Lizhi Yang)

Adam Bark adam.jtm30 at gmail.com
Thu Oct 8 15:49:04 CEST 2009


2009/10/8 Lizhi Yang <yanglizhi at gmail.com>

> Hi Adam,
>
> One more question, if I want to implement algorithms and load the huge
> amount of data using C++, but using Python as the glue language to
> implement other functionality such as Gui and txt processing, you
> think Boost.python is better or SWIG is better? Have not tried yet,
> just need to make decision first, thanks.
>
> On Thu, Oct 8, 2009 at 9:19 AM, Lizhi Yang <yanglizhi at gmail.com> wrote:
> > Hi Adam,
> >
> > Thank you so much for your help. I will do a test, and will let you
> > know the result.
> >
> > On Thu, Oct 8, 2009 at 9:15 AM, Adam Bark <adam.jtm30 at gmail.com> wrote:
> >> 2009/10/8 Lizhi Yang <yanglizhi at gmail.com>
> >>>
> >>> Below you see my original post.
> >>>
> >>> 1: Say I use boost.python.
> >>> 2: For example, I allocate a big array with integers using C++
> >>> function (4 bytes for each int in C++, but 12 bytes in python), and I
> >>> use boost.python to call those C++ functions. How is the memory
> >>> allocation for that array then?
> >>
> >> If the data is setup in C++ using native types then it will use 4 bytes
> per
> >> int. I believe boost just creates a wrapper so you can call the C++
> function
> >> as if it were a python function it then does all the conversion
> internally
> >> and will return some python type data.
> >> HTH
> >
>

Hi Lizhi, I don't really have much experience with either, personally, and I
just realised I didn't reply-all my original response so I'm CC'ing this
back to the list, hopefully you'll get a useful response there.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20091008/1ac1673f/attachment.htm>


More information about the Tutor mailing list