[Top][All Lists]

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

[igraph] Speed comparison of R and C

From: William Tu
Subject: [igraph] Speed comparison of R and C
Date: Mon, 7 Feb 2011 11:43:30 -0500

Dear igraph users,

I plan to implement a routing algorithm using igraph. Performance is
critical for me and I'm thinking about using whether C or R interface.
Previous someone claims that there is about 10% overhead using R
interface. I did an experiment as follow:
1. Create a full graph
2. For each edges, attach two attributes
3. For all edges, randomly pick an edge and read/write its value

In R:
100 nodes, 4950 edges: 4 sec
200 nodes, 19900 edges: 111 sec
300 nodes, 44850 edges: 532 sec

In C:
100 nodes, 4950 edges: 0.036 sec
200 nodes, 19900 edges: 0.108 sec
300 nodes, 44850 edges: 0.227 sec

C is about 1000 times faster. However, in the mailing list, it seems
most people are using python or R, and there are few discussions and
docs about igraph in C. So I'm still hesitating. Does anyone have
similar experiences?

William Tu,
Stony Brook University

reply via email to

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