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

optimizations in compilation and threading #81

Merged
merged 9 commits into from
Jul 18, 2022
Merged

Conversation

SteveMacenski
Copy link
Collaborator

@SteveMacenski SteveMacenski commented Jul 13, 2022

Partially to clean things up but also compiling with some of these flags seems to help and are the same compiler flags as used in https://romanpoya.medium.com/a-look-at-the-performance-of-expression-templates-in-c-eigen-vs-blaze-vs-fastor-vs-armadillo-vs-2474ed38d982 for comparison eith eigen/xtensor/fastor/etc more or less just assuming they know what they're doing.

While the system gets into the 20s of ms, it spends more time in the teens, so I think it has incremental help. I didn't do formal benchmarking, but its clear from the stream of values coming back to me that these flags improved things.

I haven't looked into it yet, but most of the time that we miss our loop rate, its due to 1 really odd cycle that is high. I suspect that's due to the path handler, so that might be an area to consider for optimization.

@padhupradheep
Copy link

padhupradheep commented Jul 15, 2022

Off topic and a very basic question, (sorry)

why aren't we setting a CMAKE_BUILD_TYPE , because as far as I understand, there is no default set. For a much better optimized performance we have to use the RELEASE flag right ? Or is it set somewhere else ?

https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html

@artofnothingness
Copy link
Owner

artofnothingness commented Jul 15, 2022

Off topic and a very basic question, (sorry)

why aren't we setting a CMAKE_BUILD_TYPE , because as far as I understand, there is no default set. For a much better optimized performance we have to use the RELEASE flag right ? Or is it set somewhere else ?

https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html

it usually comes as an argument

@SteveMacenski
Copy link
Collaborator Author

SteveMacenski commented Jul 15, 2022

nav2_package() macro handles that stuff, and sets to release if nothing is specified

  if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
    message(STATUS "Setting build type to Release as none was specified.")
    set(CMAKE_BUILD_TYPE "Release" CACHE
        STRING "Choose the type of build." FORCE)
    # Set the possible values of build type for cmake-gui
    set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
      "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
  endif()

Its also where C++17 is set and other related compiler warning flags

  # Default to C++14
  if(NOT CMAKE_CXX_STANDARD)
    set(CMAKE_CXX_STANDARD 17)
  endif()

  if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
    add_compile_options(-Wall -Wextra -Wpedantic -Werror -Wdeprecated -fPIC)
  endif()

Among other things

Multiple threads for control noise generation
@SteveMacenski SteveMacenski changed the title optimizations in compilation optimizations in compilation and threading Jul 16, 2022
@artofnothingness artofnothingness merged commit 2121315 into develop Jul 18, 2022
@artofnothingness artofnothingness deleted the optimizations branch July 18, 2022 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants