Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Graphical Editing of constraint is very slow in Android Studio 2.3.1

I am using constraint layout for most of UI in android studio but designing it in graphical editor is very slow. Applying constraint is very slow.

My laptop is good .i7 5th gen 16 gb ram and 500 ssd. i think there should be no performance limitations. the issue is in android studio. how to increase performance of graphical editor . please help.

Also CPU usage goes up to 50% when using graphical editor.

like image 205
Zia U Rahman Avatar asked May 28 '17 19:05

Zia U Rahman


People also ask

Why is Android Studio running so slow?

There may be many plugins in Android Studio that you are not using it. Disabling it will free up some space and reduce complex processes. To do so, Open Preferences >> Plugins and Disable the plugins you are not using.

How do I fix lag on Android Studio?

Android Studio needs at least 8 GB RAM to run better. Change your Hard Disk to SSD. Loading/Compiling/Designing/Writing time will be reduced even in 4GB RAM. Use Power Save mode from File Menu that will reduce lots of background work.

Is ConstraintLayout faster than LinearLayout?

As you can see in the chart Linear Layout is faster. My point of this example is that layouts which are created to resolve specific cases are better than more general layouts like Constraint Layout. 2. View centered in another view.

How can we solve missing constraints in constraint layout?

These attributes are not applied at runtime, so if you push your layout on a device, the widgets may appear in a different location than shown in the editor. To fix this, make sure a widget has both horizontal and vertical constraints by dragging from the edge connections.


1 Answers

There are three things to look at to improve performance:

  1. Increase VM Heap Size for Android Studio: https://developer.android.com/studio/intro/studio-config.html#adjusting_heap_size

  2. Toggle the design surface to only blueprint mode: https://developer.android.com/studio/write/layout-editor.html#change-appearance

  3. Make sure you using the latest version of the Constraint Layout library v1.0.2: https://androidstudio.googleblog.com/2017/03/constraintlayout-102-is-now-available.html

like image 198
Jamal Eason Avatar answered Oct 20 '22 19:10

Jamal Eason