Optimizing EFL All You Must Know on Boosting CPU, Memory and Battery - - PowerPoint PPT Presentation

optimizing efl
SMART_READER_LITE
LIVE PREVIEW

Optimizing EFL All You Must Know on Boosting CPU, Memory and Battery - - PowerPoint PPT Presentation

Optimizing EFL All You Must Know on Boosting CPU, Memory and Battery Usage Performance Cedric BAIL Senior Open Source Developer Samsung Open Source Group cedric@osg.samsung.com 1 Samsung Open Source Group 2 Enlightenment Foundation


slide-1
SLIDE 1

1 Samsung Open Source Group

Optimizing EFL

All You Must Know on Boosting CPU, Memory and Battery Usage Performance

Cedric BAIL – Senior Open Source Developer Samsung Open Source Group cedric@osg.samsung.com

slide-2
SLIDE 2

2 Samsung Open Source Group

Enlightenment Foundation Libraries

Quick what is this “Enlightenment Foundation Libraries” ? Benchmarking over the course of time with expedite Impact of preloading and shared cache infrastructure Impact of shared instance Energy consumption analysis with ACME Questions ?

slide-3
SLIDE 3

3 Samsung Open Source Group

Enlightenment Foundation Libraries

What is this “Enlightenment Foundation Libraries” ?

  • Toolkit created for Enlightenment 17
slide-4
SLIDE 4

4 Samsung Open Source Group

Enlightenment Foundation Libraries

Enlightenment Foundation Libraries ?

  • GUI toolkit targetting embedded device
  • Designed for creating a WM, ended up ready for any kind of applications
  • Licensed under a mix of LGPL and BSD license
  • Optimized to reduce CPU, GPU, memory and battery usage
  • Support international language requirement (LTR/RTL, UTF8)
  • Support all variation of screen and input device (scale factor)
  • Full themability (layout of the application included)
  • Profile support
  • Could be made to fit in 8MB with a minimal set of dependencies included
  • Modular design
slide-5
SLIDE 5

5 Samsung Open Source Group

Enlightenment Foundation Libraries

X11 OpenGL EINA

MEMPOOL

EVAS

JPEG PNG GIF TIFF EET SVG MORE... XRENDER OPENGL/ES X11 (SOFTWARE) FB (SOFTWARE) MORE...

EET EMBRYO EDJE ELEMENTARY E-DBUS DBUS ECORE

FILE X11 CON IPC FB EVAS QUARTZ INPUT JOB SDL WIN32/CE MORE...

EFREET MEMORY (RAM) (DATA STRUCTURES) DATA IN STORAGE (DISK/FLASH ETC.) PIXELS ON A DISPLAY IMAGE FILES IN STORAGE OTHER APPLICATIONS AND SERVICES USER INTERACTION AND FEEDBACK INPUT DEVICES AND OTHER SYSTEM SERVICES AND COMPONENTS ABSTRACTED UI COMPONENTS FROM STORAGE FREEDESKTOP .ORG STANDARDS LAYER FAST VIRTUAL MACHINE FOR LOGIC AUGMENTATION

slide-6
SLIDE 6

6 Samsung Open Source Group

Enlightenment Foundation Libraries

Evas :

  • The brain of EFL
  • Scene graph library with more than 10 years of optimization in it
  • Glytch free rendering
  • Reduce overdrawing
  • Reduce waste of memory by deduplicating as much as possible
  • Compressed glyph rendering
  • Portable (SDL, X11, Wayland, FB, DRM, Windows, Mac OS X, ...)
  • Optimized software renderer (MMX, SSE*, Neon)
  • Optimized use of GPU (optional)

▪ Support partial update if driver do ▪ Reduce context and texture switch as much as possible ▪ Reduce memory overhead

slide-7
SLIDE 7

7 Samsung Open Source Group

Enlightenment Foundation Libraries

slide-8
SLIDE 8

8 Samsung Open Source Group

Enlightenment Foundation Libraries

Elementary :

  • Widgets toolkit
  • Use Edje and Evas infrastructure
  • Screen and input independence achieved by :

▪ Scale factor ▪ Finger size

  • Profile support (define configuration on a per Window basis)
  • Fully themable
  • Support touchscreen
slide-9
SLIDE 9

9 Samsung Open Source Group

Enlightenment Foundation Libraries

slide-10
SLIDE 10

10 Samsung Open Source Group

Benchmarking over the course of time with Expedite

Optimization :

Before optimizing anything, you need numbers ! Any benchmark is a partial view of an application Try to reveal the biggest cost of all application into one Never perfect, never going to be a complete perfect picture You need reference point that are valid from one test to another

slide-11
SLIDE 11

11 Samsung Open Source Group

Benchmarking over the course of time with Expedite

Expedite :

EFL application trying to force as much frame on screen Currently tests only Evas primitive directly Work with all previous EFL version Tests specific path in our rendering pipeline If EFL support a target, expedite will work Give you a picture on how powerful a hardware is

slide-12
SLIDE 12

12 Samsung Open Source Group

Benchmarking over the course of time with Expedite

expedite score 50 100 150 200 250 300 350 400 Software i7 GL i7 RPi

slide-13
SLIDE 13

13 Samsung Open Source Group

Benchmarking over the course of time with Expedite

100 200 300 400 500 600 700 1.8 1.9 1.10 1.11 1.12

slide-14
SLIDE 14

14 Samsung Open Source Group

Benchmarking over the course of time with Expedite

1.8 1.9 1.10 1.11 1.12 300 310 320 330 340 350 360 EVAS SPEED (WEIGHTED)

slide-15
SLIDE 15

15 Samsung Open Source Group

Benchmarking over the course of time with Expedite

Conclusion :

Benchmarking in a reliable way is difficult Even with multiple round Require some human intervention to understand what is going on Give an overall idea of what is going on Need more complex code Need to improve logic to determine when the mesure is correct

slide-16
SLIDE 16

16 Samsung Open Source Group

Impact of preloading and shared cache infrastructure

EFL is designed for the embedded world, but is used on the desktop Multiple application running at the same time The more application can fully run at the same time the better Time to first frame is critical Scenario with no swap common

slide-17
SLIDE 17

17 Samsung Open Source Group

Impact of preloading and shared cache infrastructure

Reducing memory usage per application help

Having a software backend help (GL consume more than 10MB) Letting the kernel deal when to throw away data help (mmap) Reducing memory duplication per process is a first step

  • String share
  • Eet
  • Image/Font cache
  • Copy On Write
slide-18
SLIDE 18

18 Samsung Open Source Group

Impact of preloading and shared cache infrastructure

Reducing memory usage globally is necessary

Every application that is using EFL as at least one thing in common

EFL !

Meaning that part of libraries initialisation could be shared

Welcome quicklaunch !

If application use the system theme, they have visually a lot in common Image/Glyph/Font geometry are costly to load and consume memory Sharing is doable, but tricky

Welcome Cserve2 !

slide-19
SLIDE 19

19 Samsung Open Source Group

Impact of preloading and shared cache infrastructure

Pros of quicklaunch :

Libraries are preloaded in memory Link is done once Partial initialisation done once Preload library in memory at boot time

Cons of quicklaunch :

Tools need to read the updated argv[0] Quicklaunch does some of the job of systemd –user

slide-20
SLIDE 20

20 Samsung Open Source Group

Impact of preloading and shared cache infrastructure

Pros of CServe2 :

Decode image/glyph once Share pixels data Faster startup time, reduced memory usage

Cons of quicklaunch :

Propagate security credential not implemented, only user level No integration with kernel to act in OOM situation Difficult to do restart on crash without crashing client Need client to have the same theme !!!

slide-21
SLIDE 21

21 Samsung Open Source Group

Impact of preloading and shared cache infrastructure

RPi Free memory RPi Cached memory 10000 20000 30000 40000 50000 60000 70000 80000 None Quicklaunch CServe2 Quicklaunch + CServe2

slide-22
SLIDE 22

22 Samsung Open Source Group

Impact of preloading and shared cache infrastructure

ELM_FIRST_FRAME=t elemines 0,5 1 1,5 2 2,5 3 3,5 4 4,5 None Quicklaunch CServe2 Quicklaunch + CServe2

slide-23
SLIDE 23

23 Samsung Open Source Group

Impact of preloading and shared cache infrastructure

Power consumption :

Normal = 2W * 4.20s Quicklaunch = 2W * 2.97s Cserve2 = 2W * 4.26s Quicklaunch + Cserve2 = 2W * 3.10s (Energy consumption is an average)

slide-24
SLIDE 24

24 Samsung Open Source Group

Impact of preloading and shared cache infrastructure

Conclusion

Preloading and partial initialisation of EFL does payoff Could be improved by preconnecting to X and preloading theme Need to find a proper fix to integrate with systemd user session

slide-25
SLIDE 25

25 Samsung Open Source Group

Impact of shared instance

Alternative to preloading: single instance Use case, one process, multiple window : Terminology Doesn't apply to all applications Doesn't provide process separation... One goes down, everyone goes down !

slide-26
SLIDE 26

26 Samsung Open Source Group

Impact of shared instance

slide-27
SLIDE 27

27 Samsung Open Source Group

Impact of shared instance

RPi Free memory RPi Cached memory 10000 20000 30000 40000 50000 60000 70000 80000 Multi process Single instance

slide-28
SLIDE 28

28 Samsung Open Source Group

Impact of shared instance

Conclusion :

It does improve cost especially for big desktop application Would be a good potential for systemd –user session Has limitation that can't be overcome, so not a generic solution

slide-29
SLIDE 29

29 Samsung Open Source Group

Energy consumption analysis with ACME

All energy mesurement where done with Open Source tools Require a specific hardware based on BeagleBone Black Great potential for automatic testing Easy to read sensor without using the provided tool Still a lot of change going on Nice web interface and native user interface Not perfect yet, but it's open source, so we can get it to do what we need ! Still lacking a benchmark mode

slide-30
SLIDE 30

30 Samsung Open Source Group

Energy consumption analysis with ACME

slide-31
SLIDE 31

31 Samsung Open Source Group

Energy consumption analysis with ACME

You can find more information at :

https://baylibre.com/acme/

slide-32
SLIDE 32

32 Samsung Open Source Group

Enlightenment Foundation Libraries

EFL community cares about performance So does Samsung for all its product line There is always room for improvements Evas scenegraph logic is more than 10 years old, refactoring and cleaning is necessary Improving our tests suites and especially our benchmark is a permanent task Never ending story ! Always something to improve !

slide-33
SLIDE 33

33 Samsung Open Source Group

Samsung Open Source Group

WE ARE HIRING !

Twitter: @SamsungOSG Email: osg@samsung.com

slide-34
SLIDE 34

34 Samsung Open Source Group

Questions ?

slide-35
SLIDE 35

35 Samsung Open Source Group

Thank you.