From 8210d44c477f533e5e28cbec423c85356b160012 Mon Sep 17 00:00:00 2001 From: Dominik Gleich Date: Tue, 17 Oct 2017 11:24:22 +0200 Subject: [PATCH] Change to gold linker. Summary: Benchmark conducted showed positive performance change, a gain of ~20%. Setup: ccache disabled (export CCACHE_DISABLE=1) cd build rm -rf * cmake .. time make -j8 without gold linker real 3m25,384s user 11m58,337s sys 0m37,747s real 3m48,087s user 12m57,600s sys 0m36,837s real 3m20,116s user 12m9,570s sys 0m33,643s with gold linker real 2m48,073s user 10m2,257s sys 0m27,480s real 2m55,673s user 10m13,420s sys 0m27,233s real 2m47,866s user 10m2,377s sys 0m27,323s Reviewers: teon.banek, mislav.bradac, florijan, mferencevic Reviewed By: mferencevic Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D903 --- CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8ae0492e7..b4038cfcf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,6 +72,9 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++1z -Wall") # Don't omit frame pointer in RelWithDebInfo, for additional callchain debug. set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -fno-omit-frame-pointer") + +# Use gold linker to speedup build +set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold") # ----------------------------------------------------------------------------- # dir variables