igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] Overhead of the R interface


From: Tamas Nepusz
Subject: Re: [igraph] Overhead of the R interface
Date: Tue, 23 Jun 2009 15:30:46 +0100
User-agent: Mutt/1.5.17 (2007-11-01)

Dear List,

Further to the email below, I implemented the same speed test in Python
and ran it on my machine (Intel Xeon X3360 Quad Core @ 2.83 GHz).
Obviously only on one of the cores. The results are as follows:

C version, 5x: 9.897s
Python version, 5x: 10.016s

Overhead: 10.016/9.897 = 1.012, so it's about 1%.
I think the difference between the overhead of the R and the Python
interfaces stem from the way igraph_t objects are passed back and forth
between the host language and the C core. The Graph objects in Python
hold only a pointer to an igraph_t object that's created and managed
within C, and only this pointer is passed back and forth. (This fits
Python's reference counting mechanisms and its pass-by-reference
philosophy better).

Best,
-- 
Tamas

Attachment: speedtest.py
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]