Giter VIP home page Giter VIP logo

layoutcompare's Introduction

Compare the performance with different layout with same ui.

Official Article

Official Demo

Include five type of view

Mode Explain
Empty just View(Context), empty view for compare.
Constraint Use ConstraintLayout for root view with flat hierarchy
Normal Use RelativeLayout for root view with nested hierarchy
Simple Use RelativeLayout for root view with flat hierarchy
Custom Use CustomViewGroup with java code, flat hierarchy
Total Custom Same with Custom, skip some measure step

Usage With Source Code

  1. Run app, open MainActivity.
  2. Click "jump tradtion", Click "start test"
  3. After a few minutes, Test Result will show in MainActivity.

Some Test Result (nano seconds)

Constraint Normal Simple Custom Total Custom
create 22,901,479 20,519,692 21,956,968 17,174,885 16,769,911
measure 3,587,820 6,886,500 4,071,617 3,245,275 3,082,938
layout 540,735 607,407 541,424 688,557 691,130
full_flow 27,030,034 28,013,599 26,570,009 21,108,717 20,543,979
frame 4,785,884 7,993,213 5,294,644 4,693,871 4,543,181
  1. Full_flow : create + measure + layout
  2. Frame: FrameMetrics.getMetric(FrameMetrics.LAYOUT_MEASURE_DURATION) , measure + layout

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.