I use the following code to compare the efficiency of igraph and networkx when generating a graph. The results are shown at the bottom, which indicate that **igraph is hundreds of times slower than networkx when the number of vertices exceeds 5000**.

You can run the following code directly in Python 3.x to get my results.

```
import random
import time
import igraph as ig
import networkx as nx
def ig_vs_nx(N):
g1 = ig.Graph(directed=True)
g2 = nx.DiGraph()
node_list = ["p"+str(i) for i in range(N)]
edge_set = set()
for j in range(2*N):
node1 = "p" + str(random.randint(0, N-1))
node2 = "p" + str(random.randint(0, N-1))
edge_set.add((node1, node2))
time_start = time.time()
# add nodes and edges to g1
for node in node_list:
g1.add_vertices(node)
for node1, node2 in edge_set:
g1.add_edges([(node1, node2)])
time_ig = time.time()
# add nodes and edges to g2
for node in node_list:
g2.add_node(node, name=node)
for node1, node2 in edge_set:
g2.add_edge(node1, node2)
time_nx = time.time()
print("------------------------------------------------------")
print(f"Node num: {len(node_list)}; Edge num: {len(edge_set)}")
print(f"ig time: {time_ig - time_start}s")
print(f"nx time: {time_nx - time_ig}s")
print(f"ig/nx: {(time_ig - time_start)/(time_nx - time_ig)}")
if __name__ == "__main__":
N_list = [1000, 5000, 10000, 15000, 20000]
for N in N_list:
ig_vs_nx(N)
```

Results: