Profile

Cover photo
Xavi Rigau
Works at Novoda
Attends Universitat Autònoma de Barcelona
Lives in Manresa, Barcelona
333 followers|143,824 views
AboutPostsPhotosYouTubeReviews

Stream

Xavi Rigau

Shared publicly  - 
 
 
A lot of perf tricks we use on Android are really workarounds for issues in Dalvik. ART (the runtime in Android 5+) has very different perf characteristics. I think the trick that's most likely to be affected is object pooling. Here's why:

Dalvik's allocator is surprisingly outdated. It is not designed for multicore systems. There's a single global lock for allocations and deallocations. This means that allocations are ridiculously expensive compared to ART, which has thread-local allocation. So avoiding allocations by object pooling can be a big win.

On ART, though, POJO allocations are super cheap. ART actually uses fixed-size object pools under the hood, and because they use C++ tricks that aren't available in Java (like inferring the pool from the address of the object), the cost is comparable to the cost of managing an object pool in Java. Based on code analysis, I expect allocations to be slightly slower and deallocations to be slightly faster than a good Java object pool implementation.

That's not the whole story, though. ART also has a significantly more sophisticated generational collection model. Objects with short lifetimes are incredibly cheap to collect. But because of the way ART does concurrent collection, arrays of references can be kind of expensive. The cost is roughly proportional to the amount of churn in the array, so an object pool that sees heavy use is actually more expensive than a set of short-lived allocations.

All of which means that on ART, pooling is not an automatic win. Instead, the rules for pooling become pretty much the same as any other runtime: pool objects that are either (a) expensive to create, or (b) expensive to destroy.

As I mention in APP season 2 episod 10, Paint and Paint-related objects satisfy both of those conditions. But most POJOs don't.
16 comments on original post
2
1
Salvador Rigau's profile photo
Add a comment...

Xavi Rigau

Shared publicly  - 
 
 
We've wrote up a summary for all those that couldn't make it to the last Android Meetup in London. Some Novoda clients kindly let us show off a few concepts for consideration of how we will transition to Material Design. #materialdesign #design #androiddev
3
1
Salvador Rigau's profile photo
Add a comment...

Xavi Rigau

Shared publicly  - 
 
 
In response to +Tavon Gatling 's post on the Watch callbacks base class! (https://plus.google.com/u/0/101581283591300788111/posts/je1SJtu5RCE) I took the code and turned it into a registrable class so that you don't need to extend another Activity. https://gist.github.com/blundell/bba18a128214d5fa1250

Remember ` activity.getApplication().registerActivityLifecycleCallbacks()` is your new best friend
1
Add a comment...

Xavi Rigau

Shared publicly  - 
 
"Ladies and gents, we're about to begin"
4
1
Salvador Rigau's profile photo
Add a comment...

Xavi Rigau

Shared publicly  - 
 
 
We're excited to announce that Google I/O Extended London 2014 will be held in Google Campus and local venue XOYO, for our biggest Extended event yet!

Join us on June 25th & 26th for a 2-day event of developer sessions, inspirational showcases and a few surprises. As usual we'll kick off at 4pm on Day 1 to watch Google's I/O Keynote live from San Francisco.

Registration is not open yet and we'll have plenty more details to follow - check back soon and we'll be happy to answer any questions here. What would you most like to see at I/O Extended 2014?
1
Add a comment...

Xavi Rigau

Shared publicly  - 
 
 
Android's OpenGL font renderer explained

I just wrote an article to explain how we implemented Android's OpenGL text renderer. This font renderer can handle a large number of fonts and glyphs dynamically and so so efficiently on a wide array of devices and GPUs. It is by no means perfect but you might find some of our tricks helpful.

#androiddev   #opengl   #android  
Efficient text rendering with OpenGL ES
1
Add a comment...

Xavi Rigau

Shared publicly  - 
 
MUBI is the world's most dynamic online cinema. Every day MUBI selects a gr...
1
Add a comment...
Have him in circles
333 people
Ali Derbane's profile photo
David González's profile photo
Alex de Fuenmayor's profile photo
Mathias Dahl's profile photo
Paul Blundell's profile photo
Toni Mangas Forner's profile photo
Novice Garcia's profile photo
Adam Brown's profile photo
yelly noii's profile photo

Xavi Rigau

Discussion  - 
 
[BUG] If I click in the Discover option on the left drawer then it opens a new instance of the Discover Activity but it shouldn't
1
Ataul Munim's profile photoXavi Rigau's profile photo
7 comments
 
noice noice
Add a comment...

Xavi Rigau

Shared publicly  - 
 
 
Couldn't be more excited! I'll be speaking at +droidcon London  for the first time. Come and join this amazing lineup of speakers 
1
Add a comment...

Xavi Rigau

Shared publicly  - 
 
 
I break things
1
Add a comment...

Xavi Rigau

Shared publicly  - 
 
 
I've just released HideyBarPhotoViewScreen v. 1.1 It solves a bug that was causing problems when zooming in/out
http://goo.gl/ySa5Zh 
Contribute to HideyBarPhotoViewScreen development by creating an account on GitHub.
1
Add a comment...

Xavi Rigau

Shared publicly  - 
 
Cool!
 
If you give about 50 people enough time, they might eventually take an endless selfie. #selfiecircle   #androiddevdays   #gdg  
3
Add a comment...
People
Have him in circles
333 people
Ali Derbane's profile photo
David González's profile photo
Alex de Fuenmayor's profile photo
Mathias Dahl's profile photo
Paul Blundell's profile photo
Toni Mangas Forner's profile photo
Novice Garcia's profile photo
Adam Brown's profile photo
yelly noii's profile photo
Education
  • Universitat Autònoma de Barcelona
    Ingeniería Informática de Sistemas, 2008 - present
Basic Information
Gender
Male
Apps with Google+ Sign-in
  • LIMBO
  • Skyward
Work
Occupation
Android Developer
Employment
  • Novoda
    Android Software Craftsman, 2013 - present
  • Tempos21 (Atos International)
    Android Developer, 2010 - 2012
  • NO2
    Mobile Developer, 2012 - 2013
Places
Map of the places this user has livedMap of the places this user has livedMap of the places this user has lived
Currently
Manresa, Barcelona
Links
YouTube
Other profiles
Public - 10 months ago
reviewed 10 months ago
1 review
Map
Map
Map