;; scheme-example.scm (use digraph) (define VERTEXES 250000) (define EDGES 100) (define g (make-digraph 'depgraph "dependency graph")) (define (digraph-ins-edge) (display "\n Digraph - Inserting edges\n") (do ((i 0 (+ i 1))) ((= i VERTEXES)) (do ((j 0 (+ j 1))) ((= j EDGES)) ((g 'add-edge!) (list i j 'e))))) (digraph-ins-edge) $ csc -O2 scheme-example.scm -o scheme-example $ time ./scheme-example Digraph - Inserting edges Segmentation fault (after almost a 1 minute and high cpu usage) ---------------------------------------------------------------------------- // boost-example.cpp #include #include using namespace std; using namespace boost; typedef boost::adjacency_list Graph; int main() { cout << "Creating the graph!" << endl; Graph g(250000); cout << "Inserting edges" << endl; for (int i = 0; i < 250000; ++i) for (int j = 1; j < 100; ++j) add_edge(i, j, g); cout << "Edges inserted" << endl; } $ g++ -O2 boost-example.cpp -o boost-example $ time ./boost-example Creating the graph! Inserting edges Edges inserted real 0m2.991s user 0m2.280s sys 0m0.584s