Android studio benchmark github

Android studio benchmark github

A library to benchmark code snippets, similar to unit tests. Example:

To get started, see Requirements and Installation. See Usage for a full example and the User Guide for a more comprehensive feature overview.

It may also help to read the Google Test documentation as some of the structural aspects of the APIs are similar.

The library can be used with C++03. However, it requires C++11 to build, including compiler and standard library support.

The following minimum versions are required to build the library:

  • GCC 4.8
  • Clang 3.4
  • Visual Studio 14 2015
  • Intel 2015 Update 1

This describes the installation process using cmake. As pre-requisites, you’ll need git and cmake installed.

See dependencies.md for more details regarding supported versions of build tools.

This builds the benchmark and benchmark_main libraries and tests. On a unix system, the build directory should now look something like this:

Next, you can run the tests to check the build.

If you want to install the library globally, also run:

Note that Google Benchmark requires Google Test to build and run the tests. This dependency can be provided two ways:

  • Checkout the Google Test sources into benchmark/googletest .
  • Otherwise, if -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON is specified during configuration as above, the library will automatically download and build any required dependencies.

If you do not wish to build and run the tests, add -DBENCHMARK_ENABLE_GTEST_TESTS=OFF to CMAKE_ARGS .

Debug vs Release

By default, benchmark builds as a debug library. You will see a warning in the output when this is the case. To build it as a release library instead, add -DCMAKE_BUILD_TYPE=Release when generating the build system files, as shown above. The use of —config Release in build commands is needed to properly support multi-configuration tools (like Visual Studio for example) and can be skipped for other build systems (like Makefile).

To enable link-time optimisation, also add -DBENCHMARK_ENABLE_LTO=true when generating the build system files.

If you are using gcc, you might need to set GCC_AR and GCC_RANLIB cmake cache variables, if autodetection fails.

If you are using clang, you may need to set LLVMAR_EXECUTABLE , LLVMNM_EXECUTABLE and LLVMRANLIB_EXECUTABLE cmake cache variables.

Stable and Experimental Library Versions

The main branch contains the latest stable version of the benchmarking library; the API of which can be considered largely stable, with source breaking changes being made only upon the release of a new major version.

Newer, experimental, features are implemented and tested on the v2 branch. Users who wish to use, test, and provide feedback on the new features are encouraged to try this branch. However, this branch provides no stability guarantees and reserves the right to change and break the API at any time.

Define a function that executes the code to measure, register it as a benchmark function using the BENCHMARK macro, and ensure an appropriate main function is available:

To run the benchmark, compile and link against the benchmark library (libbenchmark.a/.so). If you followed the build steps above, this library will be under the build directory you created.

Alternatively, link against the benchmark_main library and remove BENCHMARK_MAIN(); above to get the same behavior.

The compiled executable will run all benchmarks by default. Pass the —help flag for option information or see the User Guide.

Usage with CMake

If using CMake, it is recommended to link against the project-provided benchmark::benchmark and benchmark::benchmark_main targets using target_link_libraries . It is possible to use find_package to import an installed version of the library.

Alternatively, add_subdirectory will incorporate the library directly in to one’s CMake project.

Either way, link to the library as follows.

Источник

Android studio benchmark github

The AndroidBenchmark is an Android Application useful for assessing the performance of any device which runs on the Android Platform. It consists of a comprehensive suite of tests which evaluate the most important components of a device, such as the CPU, Internal Storage and the Wireless Adapter.

Читайте также:  Прозрачный background android studio

We have decided to start this project firstly because Smartphones have become the most used mean to access the internet, so there must exist a standardized way to evaluate and classify their performance and secondly, since Android now the world’s most popular operating system this platform seemed like the perfect fit to collect the biggest data set.

Design and Implementation

The application consists of 7 benchmarks, each and every one of them testing a different functionality of the device under test. The benchmarks implemented are as follows:

  • CPU Benchmark This benchmark evaluates the performance of the CPU. It consists of 3 smaller benchmarks:
    Integer arithmetic: Stresses the ALU by doing lots of integer computations.
    Floating point: Stresses the FPU by doing lots of floating point computations.
    Digits of PI: Puts caching and multithreading to the test by computing digits of PI, using the Bailey–Borwein–Plouffe formula in a parallel manner.
  • Hashing Benchmark
    This benchmark computes hashes using the BCrypt Algorithm. The implementation of the BCrypt class was provided by Damien Miller.
  • Network Benchmark
    Measures download speed by downloading part of a large file from http://www.engineerhammad.com.
  • Files Benchmark
    Evaluates the read/write performance of the device using a fixed 4kb buffer, writing 16 files of 64mb each.

Firebase Authentification and Database

When first logging into the application, the device will be assigned an unique id used for anonymously auhenticating it in the Firebase System. By using that id the Application can query the Firebase Database by taking SnapShots at certain locations where dataChangeListeners are triggered. Using these SnapShots, the application retrieves the scores of an user for a particular benchmark, all its scores, or all the scores of all the users on a particular benchmark.

Data is posted in two locations in the Firebase Database, one is the path which is only accessible by the user, and the other one where all users post their scores for a particular benchmark.

State of the Art

Since the Android Operating System is so widely used, obviously there exist other Benchmark Applicatins which assess the performance of the device. Two of the most popular ones are:

AnTuTu Benchmark — A full suite of benchmarks which evaluate the CPU, RAM, GPU and the IO of a device.
The most interesting of its features is the UX metric, which assesses the User experience through multithreaded tasks and runtime application evaluation (on Dalvik or ART)

3DMARK — One of the most popular Video benchmarks on PC is also availible on Android. This benchmark evaluates the performance of device in respect to 3D graphic rendering and CPU workload processing capabilities.
At the moment of this writing, 3DMark consists of 4 tests on Android, 2 for Flagship devices and 2 for older devices comparison. Each tests assesses the performance of the device by rendering a multiple scenes with shaders, particle effects, post processing and other GPU & CPU intensive effects added.

Both of these benchmarks have been tested on over 3000 devices and have over 100000 values in their datasets.

Comparison with AnTuTu

Features AndroidBenchmark AnTuTu
UX No Yes
CPU Yes Yes
RAM No Yes
Storage IO Yes Yes
GPU No Yes
Network Yes No

BaseActivity is the superclass that all other activities extend. The class handles basic UI tasks such as inflating the drawer and header Views and setting the respectve onItemSelected and onClickListeners listeners.

MainActivty is the Activity the user is presented first. It contains a list of available benchmarks which, when tapped, launch the respective benchmark. The list is synced with the values in the Database.

BenchmarkActivity is the Activity that runs any benchmark. When first created, it will extract the payload from the intent, and by using java reflection it will dynamically instantiate an Object of type IBenchmark, depending on the payload value.
The Button on the lower screen launches a Benchmark Suite, a benchmark that will iterate though all availible benchmarks and run them.
The Drawer on the left contains the benchmarks that can be ran by the user, and by tapping one of them, an Intent is generated towards the BenchmarkActivity, with the payload as a value from the enum Benchmarks. General information about the benchmark are presented in the field above the Run button, which, when pressed starts the benchmark and shows a spinner for its entire duration.
The benchmark.run() method is ran inside an asynchronous task, which on completition launches the ScoreActivity.

ScoreActivity is the Activity that displays the user the score achieved after running the benchmark, metrics about the benchmark and a leaderboard of devices and their respective scores from the Database.

After running the benchmark on several devices, the performance assessment is very similar to the results found on more popular benchmarks (i.e. AnTuTu Benchmark)

One interesting fact we have found our during our beta deployment is that the Google Pixel Smartphone has a hashing performance (evaluated using BCrypt) several orders of magnitude higher than any other device we have tested so far. We are still analysing the cause of this discrepancy (perhaps hardware accelerated BCrypt hash computation?)

We feel that while developing this project we have learned a lot about the particularities of the Android Application Development Process, Android & Firebase specific Best Pactices, and last but not least a better understanding of the inner workings on how the complex system we carry in our pocket works and interacts with the environment, be it through sensors or the Internet.

About

Benchmark Application with online rankings for Computer Organization (College, 2nd year)

Источник

Android studio benchmark github

Project to benchmark android studio in 6 different tasks

Please use this repo here:

Name: Date: Test1: Test2: Test3: Test4: Test5: Test6: Version: OS: CPU: Memory: HardDrive: Emulator:

  • 08/03/18 13.6s | 11.9s | 3.9s | 785ms | 3288ms | 2804ms
  • AS3.2beta5
  • 18.04LTS
  • ryzen 7 2700 stock
  • 16GB DDR4
  • EVO 970 250G
  • KVM
  • 07/17/18 20.9s | 20.2s | 4.1s | 731ms | 3370ms | 2591ms
  • AS3.2beta4
  • 18.04LTS
  • i7-3770
  • 16GB DDR3
  • EVO 970 250G
  • KVM
  • 07/17/18 14.5s | 23.7s | 4.2s | 5.2s | 8.2s | 4.4s
  • ?
  • Win10
  • ryzen 7 1700 base clock 3.7Ghz
  • ?
  • Intel 600p 512G
  • GenyMotion

Steps to run tests

Test1: Clone repo. Acquire api key from https://www.themoviedb.org/account/signup Import project into android studio. After full load. Exit android studio (don’t close project first) Using a stopwatch, start Android studio which will load MovieApp project. Note time.

Test2: Directly after test 1, cold boot a Nexus5x emulator. Tools > AVD Manager select/create Nexus5x API 24. Emulated Performance > Boot option > Cold boot put a stopwatch to Run > Run app. Note time

Test4: First. Build > Make project Build > Clean project and note time «Gradle finished in»

Test5: Directly after test 4, Build > Rebuild project and note time «Gradle finished in»

Test6: First. Build > Clean Build > Make project and note time «Gradle finished in»

Please submit PR with your own results

Источник

Android studio benchmark github

AndroidStudioBenchmark (Firefox Focus for Android)

AndroidStudioBenchmark contains a large codebase to measure the compilation time in Android Studio .

You are probably familiar with the following question:

«Should I buy an i5, i7, or even i9 processor for Android development? How much RAM would be enough? How SSD/M.2/NVMe influence build time?».

AndroidStudioBenchmark is initially created for my personal youtube channel https://www.youtube.com/c/serhiyradkivskyi/about to compare the performance of top laptops to choose the best system for Android development , because I hate to wait lot of time waiting project to be built. And if we are buying laptop for 1000+ USD we want to be sure that it will perform 100% faster than our current machine. But online shops in there most — don’t give ability to make real world testing on your project to compare results. And most of tech reviewers describe laptops from designers/youtubers point of view, not that much information from real software developers.

I believe the results will help developers to make the right cost/performance trade-off decision when choosing their next Mac/PC. If you are interested — just continue reading and if you’ll find this test useful — it would be very cool if you can share your result and subscribe for my channel — it would be cool to have like minded audiance to share some more test on and get feedback on any professional stuff.

Results of Android Studio Performance testing:

Videos with test results are in this youtube playlist:

Browse like no one’s watching. The new Firefox Focus automatically blocks a wide range of online trackers — from the moment you launch it to the second you leave it. Easily erase your history, passwords and cookies, so you won’t get followed by things like unwanted ads.

1. Install Android Studio:

I was running test on Android Studio 4.1.1 .

I was using default settings while installation almost for all my tests.

Intel HAXM also must be installed if you run on Intel chip (it is installed by default with Android Studio).

I have set 4Gb RAM for my android virtual machine.

And please remember your Android SDK location.

2. Download API Level 28 SDK for this do next:

Go to: Tools -> SDK Manager

Choose Tab: SDK Platforms

Select: Android 9.0 (Pie) API Level 28 and download it.

Close Android Studio after this.

3. Install JDK 8:

I have installed: Java SE Development Kit 8u271

4. Set «JAVA_HOME» path in your Environment variables (System variables):

For me it was: JAVA_HOME: C:\Program Files\Java\jdk1.8.0_271

5. Download AndroidStudioBenchmark repository:

This is a fork of opensource Firefox browser for Android (https://github.com/mozilla-mobile/focus-android).

This is quite a big project (after all gradle modules downloaded it weights 6+Gb).

You can download it as zip file to you fast SSD location.

6. Restart you system.

Then make sure that no other programs/antivirus/browsers/big massive custom processes running.

Make sure that system is quite idle.

7. Open Android Studio.

Go to File -> Open : select Firefox Focus for Android project from your location and open it.

Wait while all gradle files will be synced , it can take up to 5-10 minutes.

8. Run next command to test speed of your machine doing next work:

Go to: View -> Tools Windows -> Terminal

Type command and press enter:

Wait for assembling to complete. Run it 3 times in a row.

First time it will be your fresh build and it will take a little longer. Two next builds will be normal one.

After each build completes make a screenshot and save time result.

While system assembling watch for you Task Manager how CPU is processing, how much RAM is used, it would be cool if you can watch CPU temperature with some tool like AIDA : https://www.aida64.com/downloads

9. Share results

If you want to share result of your test with the community, please send it to my email: serhiyradkivskiy@gmail.com and I will add it here:

Letter theme: AndroidStudioPerformanceTest

Notebook model : HP 250 G5 15.6″

Android Studio version : 4.1.1

CPU model : Intel Core i5-7200U 2.5GHz

Hard disk : SSD M.2 256Gb KINGSTON SUV400S37240G (or HDD disk model)

Test results : 8:28min, 5:43, 5:37. And screenshots for them.

Additional comments : you can write here whenever you want: The CPU was running all time 100%, laptop was extremely hot near the screen, ram was used for 80% etc, fans where running very hard etc..

Contributor : If you want to leave here a link to your youtube channel/linkedin/other contact info/alias etc — you are welcome, if not — it will be empty.

10. YouTubers and bloggers

You are free to use these results in your videos and articles as well as to run AndroidStudioBenchmark to compare Macs/PCs.

If you decide to record video with this test — it would be very cool if you could upload it to youtube!

Please make sure to add the link to this repository: https://github.com/yozhik/AndroidStudioBenchmark

Please name it: Android Studio Perfomance Test on .

So everyone could find it and watch and your audiance could repeat steps after you and compare their machine results.

The results show relative performance of Android Studio, compared to other machines running under similar conditions.

About

Firefox Focus: The privacy browser — Browse like no one’s watching.

Источник

Читайте также:  Как поменять геолокацию андроид
Оцените статью