#include #include "graph.h" #ifndef NT #define NT 1000000 #endif static int test_graph_add_batch() { size_t nt = NT; LSUP_Triple *trp; CRITICAL(trp = malloc(nt * sizeof(LSUP_Triple))); for (size_t i = 0; i < nt; i++) { //printf("i: %lu\n", i); LSUP_uri_new (NULL, trp[i].s); LSUP_uri_new (NULL, trp[i].p); LSUP_uri_new (NULL, trp[i].o); } TRACE(STR, "Triples generated."); LSUP_Graph *gr; LSUP_graph_new(LSUP_STORE_MEM, &gr); LSUP_graph_resize(gr, nt); LSUP_graph_add_trp(gr, trp, nt, NULL); TRACE(STR, "Graph populated."); LSUP_graph_free(gr); return 0; } int main() { int rc; clock_t start, end; double wallclock; start = clock(); rc = test_graph_add_batch(); end = clock(); wallclock = (end - start) / CLOCKS_PER_SEC; printf("Time elapsed: %lf s\n", wallclock); return rc; }