SWIG开销 [英] SWIG overhead
问题描述
我正在寻找一些基准测试,比较SWIG生成的模块与直接用C / Python API制作的
模块。 SWIG给出了多少开销?我看到我的代码的配置文件,它在_swig_setattr_nondinamic,_swig_setattr,
_swig_getattr等函数中花费了一些时间。
2007年2月1日02:21:35 -0800,Bart Ogryczak< B. ******** @ gmail.comwrote:
< blockquote class =post_quotes>
我正在寻找一些基准测试,比较SWIG生成的模块和直接用C / Python API制作的
模块。 SWIG给出了多少开销?我看到我的代码的配置文件,它在_swig_setattr_nondinamic,_swig_setattr,
_swig_getattr等函数中花费了一些时间。
在你决定选择低水平之前考虑使用Boost.Python。
据此( http:// tinyurl .com / 322d3p )发布它给予漂亮
的良好表现。
PS帖子不包含数字
-
Roman Yakovenko
C ++ Python语言绑定
http://www.language-binding.net/
2007年2月1日星期四上午10:21,Bart Ogryczak写道:
我正在寻找对于一些基准测试,比较SWIG生成的模块与直接用C / Python API制作的
模块。 SWIG给出了多少开销?我看到我的代码的配置文件,它在_swig_setattr_nondinamic,_swig_setattr,
_swig_getattr等函数中花费了一些时间。
有一篇描述一些基准的EuroPython论文。它是从2004年开始的,所以
事情可能有所改变(例如,SIP现已完全记录)。
http://people.web.psi.ch/geus/talks/...n2004_geus.pdf
Phil
2月1日下午12:12,Phil Thompson< p ... @ riverbankcomputing.co .uk>
写道:
2007年2月1日星期四上午10:21,Bart Ogryczak写道:
我正在寻找一些基准测试,比较SWIG生成的模块和直接用C / Python API制作的
模块。 SWIG给出了多少开销?我看到我的代码的配置文件,它在_swig_setattr_nondinamic,_swig_setattr,
_swig_getattr等函数中花费了一些时间。
有一篇描述一些基准的EuroPython论文。它是从2004年开始的,所以
事情可能有所改变(例如,SIP现已完全记录)。
http://people.web.psi.ch/geus/talks/...n2004_geus.pdf
是的,发现一个人在谷歌上搜索。但是到目前为止我还没有资助更多的东西。我想,从那时起,所有这些包装纸的性能都会有所改善。但是Python / C API的表现还是会花费多少?
无论如何,这不是关于确切的数字,更多的是关于做出决定
如果重写值得花时间。
Hi,
I′m looking for some benchmarks comparing SWIG generated modules with
modules made directly with C/Python API. Just how much overhead does
SWIG give? Doing profile of my code I see, that it spends quiet some
time in functions like _swig_setattr_nondinamic, _swig_setattr,
_swig_getattr.
On 1 Feb 2007 02:21:35 -0800, Bart Ogryczak <B.********@gmail.comwrote:Hi,
I′m looking for some benchmarks comparing SWIG generated modules with
modules made directly with C/Python API. Just how much overhead does
SWIG give? Doing profile of my code I see, that it spends quiet some
time in functions like _swig_setattr_nondinamic, _swig_setattr,
_swig_getattr.Before you decide to go "low level" consider to use Boost.Python.
According to this( http://tinyurl.com/322d3p ) post it gives pretty
good performance.
P.S. The post does not contain numbers
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
On Thursday 01 February 2007 10:21 am, Bart Ogryczak wrote:Hi,
I′m looking for some benchmarks comparing SWIG generated modules with
modules made directly with C/Python API. Just how much overhead does
SWIG give? Doing profile of my code I see, that it spends quiet some
time in functions like _swig_setattr_nondinamic, _swig_setattr,
_swig_getattr.There was a EuroPython paper describing some benchmarks. It''s from 2004 so
things have probably changed a bit (SIP is now fully documented for example).
http://people.web.psi.ch/geus/talks/...n2004_geus.pdf
Phil
On Feb 1, 12:12 pm, Phil Thompson <p...@riverbankcomputing.co.uk>
wrote:On Thursday 01 February 2007 10:21 am, Bart Ogryczak wrote:
Hi,
I′m looking for some benchmarks comparing SWIG generated modules with
modules made directly with C/Python API. Just how much overhead does
SWIG give? Doing profile of my code I see, that it spends quiet some
time in functions like _swig_setattr_nondinamic, _swig_setattr,
_swig_getattr.
There was a EuroPython paper describing some benchmarks. It''s from 2004 so
things have probably changed a bit (SIP is now fully documented for example).
http://people.web.psi.ch/geus/talks/...n2004_geus.pdfYeah, found that one googling around. But I haven′t fund anything more
up to date. I imagine, that the performance of all of these wrappers
has been improved since then. But the performance of Python/C API
would too?
Anyways, it′s not about exact number, it′s more about taking decision
if doing rewrite is worth it′s time.
这篇关于SWIG开销的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!