Skip to Content
Pro Android Apps Performance Optimization
book

Pro Android Apps Performance Optimization

by Hervé Guihot
January 2012
Intermediate to advanced content levelIntermediate to advanced
282 pages
7h 4m
English
Apress
Content preview from Pro Android Apps Performance Optimization

Accessing Memory

As we saw earlier, manipulating larger types can be more costly because of the higher number of instructions involved. Intuitively, more instructions often result in lower performance simply because of the extra work the CPU has to perform to execute them. In addition to that, code and data both reside in memory, and accessing memory itself has a cost.

Because accessing memory is a costly operation, a CPU caches the memory that was recently accessed, whether it was memory that was read from or memory that was written to. In fact, a CPU typically uses two caches organized in a hierarchy:

  • Level 1 cache (L1)
  • Level 2 cache (L2)

The L1 cache is the faster but also the smaller of the two. For example, the L1 cache could be 64 kilobytes ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Android High Performance Programming

Android High Performance Programming

Enrique López Mañas, Diego Grancini
Pro Android Graphics

Pro Android Graphics

Wallace Jackson

Publisher Resources

ISBN: 9781430239994Purchase book