Perf improvement for graph loading