Git Product home page Git Product logo

perf-native-large's Introduction

Large Native Performance Reproduction Project

Currently, this doesn't look like a very large project. But, it is. We just have to take a few steps to generate the sources from scratch while we are working out whatever inaccuracies there might have been in our code generation scripts.

Getting Started

Clone the repo:

$> git clone https://github.com/gradle/perf-native-large.git
$> cd perf-native-large

From here you need to run the generation script. It takes about 30 seconds to do it's work.

$> cd generator
$> ./gradlew run

What it's doing is populating 430 project directories in the root of this repository and the corresponding settings.gradle file which ties the projects together in one big happy multiproject build.

Specifically, it is parsing the components.txt file and generating c++ source code, header files and references to prebuit native libraries on your platform. For each othese projects and all their complicated interdependencies.

Speaking of prebuilt libraries. We need to trick the top-level build into thinking that there are some prebuilt binaries, so we can satisfiy the needs of the generated :project431 which has all ton of PrebuiltLibrary entries.

Do do that run:

$> cd ../prebuilt/util
$> ./gradlew assemble

At this point, you should be able to pop back up to the top level and run the build.

$> cd ../
$> gradle assemble

Note I haven't added a top-level build.gradle file yet because I didn't want people to see it in the repo and think this project would behave just like any other one you've used before.

Integrated profiling tools

Profiling with gradle-profiler

Use the Gradle profiler to --benchmark or --profile scenarios. The available scenarios are defined in performance.scenarios

Example usage: ./gradle-profiler --profile chrome-trace upToDateAssemble

Profiling with honest-profiler

There is a script prof.sh which automates running honest-profiler and creating a flamegraph of the execution.

These environment variables must be set to run the script:

  • JAVA_HOME : path to the JDK
  • HP_HOME_DIR : path to an installation of honest-profiler. This must be compiled from sources since it requires some changes that are in master branch.
  • FG_HOME_DIR : path to an installation of FlameGraph. This is a clone of the FlameGraph repository.
  • GRADLE_BIN : path to the gradle binary which will be used to execute the builds. Could use GRADLE_BIN=./gradlew to use wrapper.

Example command GRADLE_BIN=~/.sdkman/gradle/3.1-rc-1/bin/gradle ./profiler/prof.sh assemble

Profiling with Java Flight Recorder

There is a script jfr_prof.sh which automates running a build with Java Flight Recorder enabled.

These environment variables must be set to run the script:

  • JAVA_HOME : path to the JDK
  • GRADLE_BIN : path to the gradle binary which will be used to execute the builds. Could use GRADLE_BIN=./gradlew to use wrapper.

Example command GRADLE_BIN=~/.sdkman/gradle/3.1-rc-1/bin/gradle ./profiler/jfr_prof.sh assemble

JFR dump files will be opened with jmc -open when the profiling is over.

perf-native-large's People

Contributors

lhotari avatar eskatos avatar cbeams avatar jjohannes avatar wolfs avatar

Watchers

بلال مسلوب avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.