From 91d55d762aa8f18aec8a2c71423fb07f2f5bc6a9 Mon Sep 17 00:00:00 2001 From: Harald Geyer Date: Sat, 9 Jan 2016 14:04:28 +0100 Subject: [PATCH] Add support for profiling --- doc/profiling.md | 15 +++++++++++++++ src/Makefile.default | 8 ++++++++ 2 files changed, 23 insertions(+) create mode 100644 doc/profiling.md diff --git a/doc/profiling.md b/doc/profiling.md new file mode 100644 index 00000000..a775158a --- /dev/null +++ b/doc/profiling.md @@ -0,0 +1,15 @@ +# How to do profiling + +## Build with profiling enabled +Either edit src/Makefile.default or start make like this: +``` +PROFILING=1 make -f Makefile.yourOS +``` + +## Advice +neucoin uses a lot of CPU (mostly scrypt) while reading the block database +during startup. This might bias the tests you are doing, so it is best +to first collect profiling data of a startup sequence and copy this +away to not be overwritten. Then start neucoin again and actually do +your test. Later you can use the data from the startup sequence to +calibrate your test data. diff --git a/src/Makefile.default b/src/Makefile.default index 95c70399..b7a9213f 100644 --- a/src/Makefile.default +++ b/src/Makefile.default @@ -1,3 +1,5 @@ +PROFILING ?= 0 + CONSTANTS ?= constants.cpp BOOST_SUFFIX ?= #NO SUFFIX @@ -18,6 +20,12 @@ ifeq ($(USE_UPNP),1) LIBRARIES_QT += miniupnpc endif +ifeq ($(PROFILING),1) + CXXFLAGS += -g -pg + LDFLAGS_HEADLESS += -g -pg + LDFLAGS_QT += -g -pg +endif + SOURCES_COMMON = \ $(CONSTANTS) \ CheckClientSanity.cpp \