Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

performance improvements #45

Closed
wants to merge 78 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
8a0d740
FIFO cache added to mempool()
moneroexamples Mar 4, 2017
76bdd4e
ext/vpetrigocaches added
moneroexamples Mar 4, 2017
6d19853
mempool and block_txs caches added
moneroexamples Mar 5, 2017
fdd9891
added tx_context cache
moneroexamples Mar 6, 2017
488db09
rpccalls definitions moved to rpccalls.cpp
moneroexamples Mar 6, 2017
98d319a
one include removed from main.cpp
moneroexamples Mar 6, 2017
903b46b
time, hits and misses added to front page
moneroexamples Mar 6, 2017
2e2df62
formating f cache classes for easy read
moneroexamples Mar 8, 2017
e44f128
more formatting of cache classes
moneroexamples Mar 8, 2017
e268dcd
started reorganization of cache in index2
moneroexamples Mar 8, 2017
779f3e5
readme updated
moneroexamples Mar 8, 2017
0468780
readme updated
moneroexamples Mar 8, 2017
c2e48dd
added more things to index2 cache, but something wrong
moneroexamples Mar 9, 2017
cee9e75
index2 seems working, but more tests needed
moneroexamples Mar 9, 2017
8e14255
fmt library updated
moneroexamples Mar 13, 2017
fc2ab6e
fmt library updated
moneroexamples Mar 13, 2017
ccce444
fix: some template files were not pre-loaded
moneroexamples Mar 13, 2017
b16b933
fix: wrong usage of template_file["checkrawtx"]
moneroexamples Mar 13, 2017
882f321
disable by default mixin details in a tx context
moneroexamples Mar 14, 2017
5fa2288
process only limited number of txs from mempool on the front page
moneroexamples Mar 14, 2017
3a47277
fix: show text under mempool if more txs there are
moneroexamples Mar 14, 2017
0be1387
refactored pages numbering in index2
moneroexamples Mar 15, 2017
7ea5445
get_tx_details refactored to improve performance
moneroexamples Mar 15, 2017
15132f8
fix: mempool tx are not sorted
moneroexamples Mar 15, 2017
309a6c7
tx_context cache now differenitiate between detailed and non-detailed…
moneroexamples Mar 16, 2017
4be44a7
member checker removed
moneroexamples Mar 16, 2017
8610fb5
mempool times added
moneroexamples Mar 16, 2017
d6e047e
remove reversing txs vector in index2
moneroexamples Mar 16, 2017
3186737
rct type removed from front page to save some space
moneroexamples Mar 16, 2017
7d397df
show only max 10 inputs by default for a tx
moneroexamples Mar 16, 2017
88cfa0a
fix: mempool size on front page is correct now
moneroexamples Mar 20, 2017
a3e7fb2
tx caches size increased
moneroexamples Mar 21, 2017
01cefa5
ability to specify linkts to mainnet or testnet explorers on front page
moneroexamples Mar 24, 2017
9152b58
tiny code improvements
moneroexamples Mar 26, 2017
042cdcd
fix: block height in show_tx off by one
moneroexamples Mar 26, 2017
4225998
fix: dont attempt to read top+1 block.
moneroexamples Mar 26, 2017
ea16f93
mempool() refactored to improve performance
moneroexamples Mar 31, 2017
fbfd93f
several changes to further improve performance
moneroexamples Apr 1, 2017
251619b
custom lmdb removed
moneroexamples Apr 4, 2017
165e0ce
search() method simplified
moneroexamples Apr 4, 2017
f76bfbf
make local copy of server_timestamp on index2
moneroexamples Apr 6, 2017
655602b
update age of txs in mempool
moneroexamples Apr 6, 2017
0414dd6
add local_copy_server_timestamp to mempool()
moneroexamples Apr 6, 2017
7ecbe8b
fix: missing html closing tag
moneroexamples Apr 7, 2017
7cbd151
json representation is hidden now in toggle checkbox
moneroexamples Apr 8, 2017
7c4d3ea
typo error fixed
moneroexamples Apr 11, 2017
f0e5979
flags to enable/disbale tx, block and mempool caches added
moneroexamples Apr 13, 2017
09c9c26
several minor performance tweaks
moneroexamples Apr 14, 2017
676de86
FindMonero.cmake added
moneroexamples Apr 18, 2017
034aa94
timestamp_to_str_gm added and ext/date lib removed
moneroexamples Apr 19, 2017
4a29f1d
timestamp_to_str_local removed
moneroexamples Apr 19, 2017
af7bf4d
json_show_tx started
moneroexamples Apr 19, 2017
d98373c
basic tx info added to json_show_tx
moneroexamples Apr 19, 2017
d3bce06
basic tx info added to json_show_tx
moneroexamples Apr 19, 2017
acbbde5
basic tx info added to json_show_tx
moneroexamples Apr 19, 2017
49697f6
no_confirmations for mempool is zero now
moneroexamples Apr 19, 2017
a73c9a8
jsent json api convention addapted to json_show_tx
moneroexamples Apr 19, 2017
9968c11
json_txs added
moneroexamples Apr 20, 2017
71cfa03
json_blk added
moneroexamples Apr 20, 2017
76a966f
new data added to get_tx_json
moneroexamples Apr 20, 2017
7dab991
json methods return json instead of string now
moneroexamples Apr 21, 2017
e51966f
json_mempool added
moneroexamples Apr 21, 2017
9501d44
json_mempool
moneroexamples Apr 21, 2017
6794099
new json api examples added to README
moneroexamples Apr 21, 2017
07d84b0
wrong port in readme fixed
moneroexamples Apr 21, 2017
b7620dc
json_search added
moneroexamples Apr 21, 2017
9c29b0c
json_outputs added
moneroexamples Apr 22, 2017
7dd0f8f
json_outputs added
moneroexamples Apr 22, 2017
27226de
curl for json in readme updated
moneroexamples Apr 22, 2017
3611c79
api/transactions?page=<page_no>&limit=<tx_per_page> added
moneroexamples Apr 22, 2017
e68fba1
screenshot removed
moneroexamples Apr 22, 2017
2b68fe2
readme updated
moneroexamples Apr 22, 2017
c4b2363
cross header added
moneroexamples Apr 22, 2017
cff564c
bad_lexical_cast catched for tx_prove
moneroexamples Apr 22, 2017
65c36dc
enable-json-api option added
moneroexamples Apr 24, 2017
0b20503
fix: checking signed tx data works now.
moneroexamples Apr 26, 2017
1f3a778
checkrawtx.html modified
moneroexamples Apr 26, 2017
b68a45d
tx_details.html amended
moneroexamples Apr 27, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
162 changes: 37 additions & 125 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,37 @@ project(${PROJECT_NAME})

set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} -std=c++14")

if (WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wa,-mbig-obj -O3")
endif()


if (NOT MONERO_DIR)
set(MONERO_DIR ~/monero)
endif()

message(STATUS MONERO_DIR ": ${MONERO_DIR}")

set(MONERO_SOURCE_DIR ${MONERO_DIR}
CACHE PATH "Path to the root directory for Monero")

# set location of monero build tree
set(MONERO_BUILD_DIR ${MONERO_SOURCE_DIR}/build/release/
CACHE PATH "Path to the build directory for Monero")

set(MY_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}/cmake"
CACHE PATH "The path to the cmake directory of the current project")

list(APPEND CMAKE_MODULE_PATH "${MY_CMAKE_DIR}")

set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${MONERO_BUILD_DIR}"
CACHE PATH "Add Monero directory for library searching")

include(MyUtils)

find_package(Monero)

# find boost
find_package(Boost COMPONENTS
system
Expand All @@ -26,80 +53,12 @@ find_package(Boost COMPONENTS
REQUIRED)


# set location of monero static libraries
set(MONERO_LIBS_DIR
/opt/monero-dev/libs)

# set location of moneroheaders
set(MONERO_HEADERS_DIR
/opt/monero-dev/headers)

# include monero headers
include_directories(
${MONERO_HEADERS_DIR}/src
${MONERO_HEADERS_DIR}/external
${MONERO_HEADERS_DIR}/build
${MONERO_HEADERS_DIR}/contrib/epee/include
${MONERO_HEADERS_DIR}/external/easylogging++
${MONERO_HEADERS_DIR}/external/db_drivers/liblmdb)

if(APPLE)
include_directories(/usr/local/opt/openssl/include)
link_directories(/usr/local/opt/openssl/lib)
include_directories(/usr/local/opt/openssl/include)
link_directories(/usr/local/opt/openssl/lib)
endif()

# get individual monero static libraries
# that are needed in this project

add_library(common STATIC IMPORTED)
set_property(TARGET common PROPERTY IMPORTED_LOCATION ${MONERO_LIBS_DIR}/libcommon.a)

add_library(blocks STATIC IMPORTED)
set_property(TARGET blocks PROPERTY IMPORTED_LOCATION ${MONERO_LIBS_DIR}/libblocks.a)

add_library(cryptoxmr STATIC IMPORTED)
set_property(TARGET cryptoxmr
PROPERTY IMPORTED_LOCATION ${MONERO_LIBS_DIR}/libcrypto.a)

add_library(cryptonote_basic STATIC IMPORTED)
set_property(TARGET cryptonote_basic
PROPERTY IMPORTED_LOCATION ${MONERO_LIBS_DIR}/libcryptonote_basic.a)

add_library(cryptonote_core STATIC IMPORTED)
set_property(TARGET cryptonote_core
PROPERTY IMPORTED_LOCATION ${MONERO_LIBS_DIR}/libcryptonote_core.a)

add_library(cryptonote_protocol STATIC IMPORTED)
set_property(TARGET cryptonote_protocol
PROPERTY IMPORTED_LOCATION ${MONERO_LIBS_DIR}/libcryptonote_protocol.a)

add_library(daemonizer STATIC IMPORTED)
set_property(TARGET daemonizer
PROPERTY IMPORTED_LOCATION ${MONERO_LIBS_DIR}/libdaemonizer.a)

add_library(mnemonics STATIC IMPORTED)
set_property(TARGET mnemonics
PROPERTY IMPORTED_LOCATION ${MONERO_LIBS_DIR}/libmnemonics.a)

add_library(epee STATIC IMPORTED)
set_property(TARGET epee
PROPERTY IMPORTED_LOCATION ${MONERO_LIBS_DIR}/libepee.a)

add_library(blockchain_db STATIC IMPORTED)
set_property(TARGET blockchain_db
PROPERTY IMPORTED_LOCATION ${MONERO_LIBS_DIR}/libblockchain_db.a)

add_library(lmdb STATIC IMPORTED)
set_property(TARGET lmdb
PROPERTY IMPORTED_LOCATION ${MONERO_LIBS_DIR}/liblmdb.a)

add_library(ringct STATIC IMPORTED)
set_property(TARGET ringct
PROPERTY IMPORTED_LOCATION ${MONERO_LIBS_DIR}/libringct.a)

add_library(wallet STATIC IMPORTED)
set_property(TARGET wallet
PROPERTY IMPORTED_LOCATION ${MONERO_LIBS_DIR}/libwallet.a)

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin" OR WIN32)
add_library(unbound STATIC IMPORTED)
Expand All @@ -125,55 +84,7 @@ set(SOURCE_FILES
add_executable(${PROJECT_NAME}
${SOURCE_FILES})

# Get the current working branch
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)

# http://xit0.org/2013/04/cmake-use-git-branch-and-commit-details-in-project/
# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)

# Get the date and time of last commit
execute_process(
COMMAND git log -1 --format=%cd --date=short
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_DATETIME
OUTPUT_STRIP_TRAILING_WHITESPACE
)


configure_file(
${CMAKE_SOURCE_DIR}/src/version.h.in
${CMAKE_BINARY_DIR}/gen/version.h
)

include_directories(${CMAKE_BINARY_DIR}/gen)

macro(configure_files srcDir destDir)
message(STATUS "Configuring directory ${destDir}")
make_directory(${destDir})

file(GLOB templateFiles RELATIVE ${srcDir} ${srcDir}/*)
foreach(templateFile ${templateFiles})
set(srcTemplatePath ${srcDir}/${templateFile})
if(NOT IS_DIRECTORY ${srcTemplatePath})
message(STATUS "Configuring file ${templateFile}")
configure_file(
${srcTemplatePath}
${destDir}/${templateFile}
@ONLY)
endif(NOT IS_DIRECTORY ${srcTemplatePath})
endforeach(templateFile)
endmacro(configure_files)
create_git_version()

configure_files(${CMAKE_CURRENT_SOURCE_DIR}/src/templates ${CMAKE_CURRENT_BINARY_DIR}/templates)
configure_files(${CMAKE_CURRENT_SOURCE_DIR}/src/templates/css ${CMAKE_CURRENT_BINARY_DIR}/templates/css)
Expand All @@ -196,6 +107,7 @@ set(LIBRARIES
common
mnemonics
epee
easylogging
${Boost_LIBRARIES}
pthread
unbound
Expand All @@ -204,16 +116,16 @@ set(LIBRARIES
ssl)

if (NOT ${CMAKE_SYSTEM_NAME} MATCHES "Darwin" AND NOT WIN32)
set(LIBRARIES ${LIBRARIES} unwind)
set(LIBRARIES ${LIBRARIES} unwind)
endif()

if (WIN32)
set(LIBRARIES ${LIBRARIES}
wsock32
ntdll
ws2_32
Iphlpapi
)
wsock32
ntdll
ws2_32
Iphlpapi
)
else()
set(LIBRARIES ${LIBRARIES} dl)
endif()
Expand Down