Embed code
Note: this content has been automatically generated.
which is normally happens isn't normal fashion as for example here of enormous yeah it
using more memory not at twenty percent more it's definitely more than just into just
also application gets larger it's going to uh to calculate and all that stuff
but it isn't really a big problem because if you use something like dependency
injection you can nearly need black says saying you know that'll be
ralph that problem if you have anything they're quite some heavy application based
on in and try to avoid that try to use program
get rid of the you know it was just a use of slack if
you use enumeration enumeration with a lot of internal its object programming or
you lose some puzzles logic inside of the norwegian then you should try to
keep that i'll try to make that a little bit differently but
you know i'm normally not a major issue of application of it comes
a performance let's look on them memory example io when you use
the network we haven't rest eighty or choosing at that point and try to optimise their the first thing you should always too
check if jesus activated as compression by incoming and outgoing calls if
you lose for example are great to fit it's automatically
inside also so something that's at automatically they had asked for you if you're doing it yourself right at the
supper so so it that supports that it's also important to so i said doesn't support that it doesn't makes sense
it's it's the cells will always talk was also like i said that under the a. p. i. guys
that always should have it uses available on the server side so we
can call that and the response gets a visit compressed example
we haven't let's talk about one megabyte file which you want to download isn't jason response if it would without compressions one
megabyte if if you just for compression was optimisation said can we see and just fifty colour white or one hundred two white
oh have not just less memory uh to network traffic that you're creating you help also the user to have less
traffic problem when it comes with a contract that you guys all flap of us that some binary protocol which
is more or less heavily used in the uh uh games area also there's photograph and wire from
fish or and scrap and now let's look until application we first started application be a lot i'm not
a showing to the user you see a lot of network traffic gets as much at first
but then you call that occasion and restarts application just showing an image if you have such a screen
then you failed reasonable you should really avoid that point especially if this is the same much oh
trying to cash data on disk lot of which i was doing that automatically for you don't use all
these ourselves also so much that can happen to at that point for them as they have
a concept that would network taken at cache that's that's being along you
should have that in your uh in your cash before it's get
an idea and should try to get a new one also the normal h. t. t. p. responses for example of revenues or
information and you know you are user information won't change the next five days definitely try to cash it
use kitchen has on the server side right uh i try to catch all these images then the
second shot should look like that no network character just control one which is our second happy at
that point was that the right i don't well known i was there were transferred for example
you take a that can use or the last modified and said
that and also stomach cancer that's as was introduced and eighty
three one or two one one one one one one uh so you can really gains idea there how you can cash
probably on your line side and you just got up scheduler for ever read occurring
past like for example try it doesn't want uses it meant any more
than one uses intentions application no one then you can you are happy you
will not need to stop sketch anymore um because that helps to patch
up a lot of calls from different applications and those those model helps to get
away from all this get killed and to review everything well we can
break take a break and take a coffee can relax so but but the old on fire now with that a lot of things was uh
was performance we can do much more at that point so the next thing to try showing you shouldn't really
take everything for you because it's not really teen court i can say from the beginning it's not regarding
making between coats that every time and that's and and it's not like the book it's optimising for performance at
if it would after but it takes a lot of time if it would in a regular up
as normal review step to each other to that uh colleagues that has
a lot at that point just stick to that make it own
habit to do it like that and then the and even though it was like an optimism about how we use every list
because that's in that every developer uses the you have all these list never ever just one item if you have that it's really
not perfect rolled tell you have ever list for example we tried to get a list of the attendees as in the string
we haven't had anyone just the names from them you create a new era lest i be to it over that at
the names and return the names you can oh but but at that point we can use the size of that
input we're very or or matter was that we are optimising already because
if we say from the beginning for example these are wanted fifty
or how many i tended to have this weekend one that but then we have two hundred people there at i think the size
so a few facts as an example you haven't and the air
a minimal little installation of an area as sixteen elements
not every time if we reach that limit you making system copy of this area
but yet you really don't really take a look at that part because
avoid that you know from the beginning you have two hundred attendees said that that's a little parameter for the list and initialise this right
at that point with a nice that you need and you avoid the system could be in the end because that's really expensive if
you do it several times and several thousand times and taken performance actually even over from the beginning now we think we have to
go from the standpoint matson who don't haven't initialise the for that
but since power cord we can ensure the capacity of of
an uh every less unfortunate sees method is not available and this list
interface so if you are doing clean coat and doesn't propagate a
real implementation at that point you can't do something that that always have to cart check if it's and i realised casket and
sense at the right point though like i said it's not in court but you can optimise at that point if you are willing
to do some more stuff and we can optimise how we use models it's more or less the same like with those
last it's a national and the and the bundle but again you can
set initialising value because having sixteen point does or just one point
on that same hard to avoid the garbage collection after but to
remove uh to move the fifteen a pointless again we can
also optimise the string builder to users of what it's again the same
piece that's number at the top but we can rule little
but more i'll but i come to that later but again some every copy like an list but still we can optimise all
but more at that point because it's sorry that's become made up but
then we have no list of it now we can optimise loops
that easy for developers ringer for each group but that for each
group gets translated into normal air a loop and the and
the compiler and it'll do something like that in the end you just don't see it because it's all optimised for you as a
double but even just for example can be optimised all but what
samples to organise the check ups organise sizes the same
well the change should the changeable i hope that doesn't change because i never um
different problem because it's in a comp one point of occasional says list and
you have a multi threading issues so we don't have to all this exercise
again oh making more lesson member um and you variable out of that
underlies it once and we use this result then we can also see that yes
we put times the size of organisers would just want because you don't
have to do twice and operation that would be an same and the and and we can optimise more for example if you look you have
you always up and new um come after us all my that we haven't separated
list but you always checking the length of source name string boulder to
avoid that just had that always and in the end just switch on a
substrate without the common the and it's the same thing that you get
in the end but have a last calls it's hard to to make it more
performance we can all all top that might mess up on the patients
but sample here we have several times for getting gets resources get colour you
can do it once it isn't even a variable at that point
can be easily garbage collected after the method that was used and you don't have to recall to get rid of because anything can
mess up as it's not such expensive of creating something but still you have to look comes into them manner the memory
present which message you should use and which level for example let's get with us
isn't your instant on your parent or prime time or the and in
the context boat always have to make a message lookup analysis which
most efficient use 'em digit compiler helps a lot at that point it's up to my thought is that for you but it's still
not the same as it doing that from the beginning because you know what we'll do with the the and that's what from the beginning
and to avoid that but he couldn't see we're using also get
string it's convenient but what's when it's doing its thing until
only gets a resources and call to get string on the resource so
remove that use the resources you have already and that's um automatic
off method invocation practical to avoid creating of access methods that anyone
don't know what that means i want on on awfully well
we can avoid excess notice these are created by the compiler well not
classes which uses that private men bus or private methods of
the patent last words get a to find and you always have
a new methods there it doesn't pass through because the compiler
how to get the double before that because of actually you can't access is a member variables the method because it's private
and if you even see it at the class level you haven't different class of that what you are really the probably the class even if
it's an atlas so the compiler had at that point we can access is it up to a private stuff and christian message for you
that's nice that's an even have uh i have to use movie text or
their sample these can be hard to avoid multiplexing because if you
have a lot of sites things are example eric's you i'll laugh to
create an enormous classes at that point you move lose longbow
or whatever in the end it creates internally internal uh classes and then was
one best removes the private make it take it further well like
i said it's not c. code it's not encapsulating but you have to more perform cotton the and oh just removes up things like uh
publics and you have no access methods gonna with that anymore also that
that's example if m. l. or variable and haven't in that classroom
when someone draw stuff so we always all the message instead of just
remember this you'll lose a lot of time at that point
that of direct access in the memory just always makes a call the method but we can optimise more at that
point was right will you mentioned um will detect this program so that's what sixty four k. limit for method
you're not allowed to have more than sixty four k. of methods nowadays
a lot of libraries reduce their mess that even the design support
library with the removal of interprets a move towards one of fifty method
is not much buttons again better than nothing all that a
lot of libraries or whatever to reduce them a method because avoiding these
access methods that are already mentioned what you can do with your
reach that point you can do it better throughout context which means
for example changing innovations and two integers or nine in small
one nine am at a method called which it used just once again the answer byte code doesn't have
so clean code code in the end um you have all tool for example of what was
best one liner you have fifty calls offset it just ninety everyone everywhere directly instead of having it
doesn't separate method but with that you would use also so well the mets account and there
are a lot of other things and to move in classes and methods which are not used in your
code base normally if it's analysis of this it's traces sets on possibly even if that doesn't
help you have to go to move detect let's see anyone have monastic it twenty one one mistake
for product of application okay process right now we'll application i mean we real applications but
one of us using that union plaza viewed right in doing that you can reach nowadays nearly eighty percent
of the users in this new rule but what what engines other tentacles and so sure hand
avoid them well like i said if you have the money to get twenty fun we are really
fine at that point you have and don't and you don't have any problems with small detecting
anymore but if you have less than twenty one for example fifteen sixteen we have started penalties of
usable detecting what that means movie takes creates several
class files class text files for you normal
system pretty lollipop just can have one of them the startup time but which went up to first
class fire that's application and was the mood except occasionally you initialise it will detect make
thing install and then grabs the second classes text file and initialising classes
without them there so if you have just five or ten methods
oh classes on that second plastics that's not a big problem it's fast but if
you have more and more i said marketable really and break application can make
it really slow for you will be aware of the problem if you don't need
movie getting avoided me proud if it's possible if you only detecting don't
they all we have already moved addict again at ten thousand or twenty thousand method
and what you can do that obviously but usually because it became much
soul for the people who doesn't have them and stick it twenty one the
i grew much and witty
triple if you haven't more isn't shy it's not fights assignment if it's good but that's what she
must again probably not everyone will understand what i say saying inject my proper john john john
so my doctor's office for onto it like your uh batteries already mentioned i'm from well known
i am g. d. and also did you cool and i'd also and which up but
and was that i can live in the end of all the time and and whatever but
my pro as a professional a little over there and working for a
movie it's got this is in scenes uh that's low but that's
not a nobody is caught presence in switzerland switzerland is different and
the german one because uh switzerland is only available for switzerland
and so john one hour for the world so that's again something special for you guys
well look at the boat my company we are basing bowen overhead puerto that's been without a what was called
holdings soupy got conrad on or with everything that's all just got as well there are also everywhere
if you sort of about eight hundred fifty thousand s. m. m.s or uses but
when buildings uh or lights terrorists and all that what you'd as unrealistic
that's one thousand fraud fourteen alone about seven hundred ninety million was that on our website
i think on t. v. are probably susie about one billion well that's
oh it's really a lot of users searching for real estate's because
the credits which are lower than rates so we can say can buy something but other problem with their not enough at because
not if don't put enough buildings and we have i think one thing about six and a half million would or not
but the and sit down not doesn't mother and the and what's madras
also users use your application but some we have about one
point two million active users from and all these numbers on the on the look more important than the down not because
as long as in user uses application more than three days it's good user if we read that the room
removes you again that's that's volume the amp because you can't it's lifetime really out of the user though
why the audio post especially for under it i think you're
smart these believes that we're smart eleven read this
area here we have passion or doing and weight loss
challenge just to handle all sees devices guesses
isn't that just icing phones suit potent file that was the game a little button south korea
i think people that also such little malls less subtle that at
that time but nowadays you can support i think about sixteen
thousand would devices can i us to that i don't think so i so that's why we as adults have to sing
well that florida how we do all the stuff making a lot
of sings twos are making animations making these and that
but for that he didn't informant application and of course you have slipped from
something will allow money and last but not least and the most important
thing is why we are doing a notable open specials on you i
i read you laughed with delight or users don't let us up
a step back and look at first uh to use expectations but was mobile
users are really really impatient when it comes to applications that sites
can as low as they v. b. because they said that's a a
crappy but not the difference so sixty one percent of the users
every eight applications that unless and four seconds yep applications that's that's a lot
and four seconds no you of course not mine i have time
but as as a several applications are really slow for example i can safely and that's really slow when it's that out
and let scroll something that's why people introduce again and the
material guidelines the splash screen was was originally not available
i thought to be able back now we have specially data
but that's sixty percent want faster that or seconds pressing
the button showing the first screen which was reckons that doesn't
action but that's more serious fifty percent of seamless
things that applications would stop and that's in two seconds that's really huge thing for phone and the
double what makes that happen and the users are really intolerant to any issues on your application
yeah really and also like the application eighty percent if you're three or less at ten o. one
time making five seconds okay i don't like that second time pressing on a button making for
ten seconds for respond ah that time at sean's the splash screen after three seconds that occasional
removed so that's how we at double but have to handle these little straw that might
just doesn't care they say it's taken a long it takes but we have the little but they
cam more than the product but if you have to really take type even to that
topic make it willy facile use because the and also as the littlest polls like that if
it has something and when ten times the same flow i don't want to straight
five seconds each time and press that button get to the next screen was test the flow oh that's why make it fast just
a three percent of the users even delete application immediately after crash
happened or other server issues or say hell freezes on the
screen and either use it so if you do a lot of backgrounds are for work load and the user doesn't use application
directly and we still drains the battery will be removed immediately without
thinking because the batteries should last for user nearly they
that's really an impossible these days because the better that we have currently
no that's why having less that perform it also makes less
at the results in the and especially we have network connections well
see let's blame the company from a application about that to
stay apprentice application was a lot of right and some big companies using
agencies bodies application was agency doesn't get to blaming it's that
that isn't of the company who ate for the application created by
example system good next on the company to do something
yeah that back probably should get precious forget land not agency says come will be
if there was that especially if informant if there's any performance problem and
application fifty five for some blame the application was currently running but if ever
example face look on the back and doing some stuff get blamed for
that will be respectful to other developers on the system make application really good
at that point not use all the resources and even one sort of
more modern one sort of the users in less of a brand it can
destroy your brand of uh uh for for company that's really important
if you have a big company and you just right it's we we still wouldn't
have to put so much money and we are into it again to
get to let's back and so they think that over you well let's talk
about that to use expectation but now think about performance impacts on
the us in the an example you have a delay of five hundred milliseconds but you can't really they it's much but that means you have a
part of it or five percent of users the top of the applications
low reversal also the conversion rate which you try to optimise normally
lose two percent of the users for the conversion using well i fact five thousand users
and a stamp of that on the problem i think of my application we
have more than one million users even to present me twenty thousand users
yep as so that's really bad for you because especially if they pay
for example if they pay forty rose one had to suspend thousand
users less ah that's for a uh_huh eight hundred thousand you you got you
got yours you lose in the and was is that doesn't by
any see so that's really how hard fought even if you well that's
the delay one second you have a bounce back of eight points
a three percent of the users are really really awful and you have a
well we'll have percent less of conversions thing for example of amazon
let's say it's just one hundred millisecond no one tenth of a second
they lose nearly one percent of the revenue and the final shopping
cart and that's really huge if you have something like i was only lose one person of the topic of the really try to optimise all
the stuff that's right making application fast it's not just nice for you it's not nice was uses gold again won in the end
even if it's takes a lot of time to make application performance eleven thousand of the the screen at
the devices i'd would sometimes myself especially when i try to look at the flight what check and
and that i have to wait five ten fifteen seconds actually shows the next screen which is ridiculous
but doesn't of course users show their phone i normally just from my phone on the bat
and hope that doesn't like to the next area but that need rest in peace
application we're doomed we had the job but because the look was now
we can do much might appoint so let's try to find some performance of
rooms that make it i rested where it can take a look at
that's what's on c. p. u. memory when i oh and first concentrate on
c. q. well that's normal obvious sense and with one point zero keeps
the work of the main thread to avoid application out of falling screen
was a jacket and nice taylor was sent applications responding you want
talk lots application or do you want to read i think most of the
stuff we have double double save it because i'm deploying shortly and
that's why a lot of friends for help to to keep your but
from the main for battery for example are excess one example
which you can use as encounters part of is that the right schedule has the same goes for event but
where you can do something like that and you should also avoid keep you over the remains of
anyone don't know what that means i one of those don't know okay so deeply will uh overdrive please
for example you have a background then you put in takes another small but confound item on that
and after that i can and background and the background so every time you draw something door the colour on the same
place several times but we try to avoid to doing that for example you have an effect on what is right
and a small takes you possess the background with white again we've got pane right on right and that takes a
performance at that point because you have to do with the operation on the graphics part but every carcasses layout
so if you reduce that we have also also trying at
yours as green avoid knesset multi pass layout that
can be expensive if we have for example a large purity and pointed multiplex little things for example
yeah or uh just also run smoother thing was to on they or and and the light is how
we have to handle the size that's how a lot and viewers of for example that's what of
layout for example would at least twice at first you go through and i that's how was that
tryouts are are related to each other and then it goes against what and how that
matches the real sizes of the views which you want to draw later on
nowadays you have courtenay to lay out just at at at back to the to the you can combine
relatives layout and the and there were things it's but more
complicated probably have to define special rules between the views
but it's unfortunate uh well obviously you out it's just to be that
currently you can use it obviously with the rates that there
are probably back and a lot of making changes but it's still better on that sets of things that you had before
and comes comes about using venice group were heavily computational stuff
for example it would making image processing on the device
right to get out and to run the script run the script is not yeah huh
it's a simple where you can do a lot of stuff like that which is nearly as far as as a
c. last last but you avoid ever conceived justices doesn't run of work and you can reuse it little either
oh that's see puerile let's move on to the memory not allocate memory or
any memory wiener variables and on drummers that for example you have um
on draw you always re initialise for example to paint method
it sounds nice is clean code because it's a encapsulate everything what you're using
but the point is the control method is called sixty times per second
and creating a lot of objects there half means you have a lot of comet collections stops vaults nearly
so are we don't do that with just one runs on that
are constructed for example outside and reuse for rail and just
change the values and don't always played you object or a locate you memory
as widely it's it's easy to say we are not got we don't see everything
probably not everyone is about well both savvy can how as well but with the cannery it's easy to install we have
two different at least two different a dependency budget at one
for your normal difficult it's it's a real implementation
and the mob implementation for the release compare so we don't have to change always your code depending
of of of of you haven't really is application on the local publication and this file is
to actually they just have to use we can we don't install and that's all you have to
do it in the local and then normal the open proxies using the application and using
an using it and once you get says the screen thank you have probably elites there take a
look and we as understandable develop well go to our memory an ally that and and routes
to deal with someone take it changes on the screen he mentioned and then we see that
to wrapping up uh you know that yeah wrapping up all this but everyone patient into
take a lot of time and doesn't get fried that means you have they're definitely a leak at that screen though that's taken
he number of also system that you have to press or the second the small button and then you get in
listing of lot of objects in the memory how many a memory
that consume a lot of statistics around that then you
can tune open an ally that task which is everyone on it so you can pay to take a leak activities
and then he's saying the main activity the okay we get all already from that we can know it but you can also
see but it has any references you get used it's hard to say which one you have to keep that love
it at that point it's the whole topic for itself to look into it you probably several days to uh to be
really understands if you're not from we're versus a mentally terms but when you first on a central would use
you get to it's really fast and efficient get used to it and was that you avoid
leaks and this helps application the and because normally the least but you have an application
with or you get out memories it's not a sauce also out of memory the real culprit
is much before oh then we fix the mentally you do several orientation changes and
there's a wonderful thing should look like that mean all change of reuse of application always the same
there's probably some doubt collection behind it because with every orientation issues from things
away and get some new stuff but then it should really look
like that was small bombs that would be fine avoid listeners use something
like an event was for example i know for example previously
because somehow okay even event passes i'm not but that's why we should
use something out but i personally think that was really good thing
if uses the right way you should use it for everything was that you can avoid really having a lot of listeners and
you don't forget for example to realise uh listen i can't just added now like
especially as a listener as activity overview that's like that you don't get
rid of subjectivity and to have a leak at that point you just past
her family they are optimised hash mad and collections were you can really
for example give as a key in integer and it works without boxing and boxing stuff

Share this talk: 

Conference program

Jean-Baptiste Clion, Coordinator DevFest Switzerland
26 Nov. 2016 · 9:40 a.m.
How to convince organization to adopt a new technology
Daria Mühlethaler, Swisscom / Zürich, Switzerland
26 Nov. 2016 · 10:14 a.m.
Q&A - How to convince organization to adopt a new technology
Daria Mühlethaler, Swisscom / Zürich, Switzerland
26 Nov. 2016 · 10:38 a.m.
Animations for a better user experience
Lorica Claesson, Nordic Usability / Zürich, Switzerland
26 Nov. 2016 · 11:01 a.m.
Q&A - Animations for a better user experience
Lorica Claesson, Nordic Usability / Zürich, Switzerland
26 Nov. 2016 · 11:27 a.m.
Artificial Intelligence at Swisscom
Andreea Hossmann, Swisscom / Bern, Switzerland
26 Nov. 2016 · 1:01 p.m.
Q&A - Artificial Intelligence at Swisscom
Andreea Hossmann, Swisscom / Bern, Switzerland
26 Nov. 2016 · 1:29 p.m.
An introduction to TensorFlow
Mihaela Rosca, Google / London, England
26 Nov. 2016 · 2:01 p.m.
Q&A - An introduction to TensorFlow
Mihaela Rosca, Google
26 Nov. 2016 · 2:35 p.m.
Limbic system using Tensorflow
Gema Parreño Piqueras, Tetuan Valley / Madrid, Spain
26 Nov. 2016 · 3:31 p.m.
Q&A - Limbic system using Tensorflow
Gema Parreño Piqueras, Tetuan Valley / Madrid, Spain
26 Nov. 2016 · 4:04 p.m.
How Docker revolutionized the IT landscape
Vadim Bauer, 8gears AG / Zürich, Switzerland
26 Nov. 2016 · 4:32 p.m.
Closing Remarks
Jacques Supcik, Professeur, Filière Télécommunications, Institut iSIS, HEFr
26 Nov. 2016 · 5:11 p.m.
Rosie: clean use case framework
Jorge Barroso, Karumi / Madrid, Spain
27 Nov. 2016 · 10:05 a.m.
Q&A - Rosie: clean use case framework
Jorge Barroso, Karumi / Madrid, Spain
27 Nov. 2016 · 10:39 a.m.
The Firebase tier for your app
Matteo Bonifazi, Technogym / Cesena, Italy
27 Nov. 2016 · 10:49 a.m.
Q&A - The Firebase tier for your app
Matteo Bonifazi, Technogym / Cesena, Italy
27 Nov. 2016 · 11:32 a.m.
Hasan Hosgel, ImmobilienScout24 / Berlin, Germany
27 Nov. 2016 · 11:45 a.m.
Q&A - PERFMATTERS for Android
Hasan Hosgel, ImmobilienScout24 / Berlin, Germany
27 Nov. 2016 · 12:22 p.m.
Managing your online presence on Google Search
John Mueller, Google / Zürich, Switzerland
27 Nov. 2016 · 1:29 p.m.
Q&A - Managing your online presence on Google Search
John Mueller, Google / Zürich, Switzerland
27 Nov. 2016 · 2:02 p.m.
Design for Conversation
Henrik Vendelbo, The Digital Gap / Zurich, Switzerland
27 Nov. 2016 · 2:30 p.m.
Q&A - Design for Conversation
Henrik Vendelbo, The Digital Gap / Zurich, Switzerland
27 Nov. 2016 · 3:09 p.m.
Firebase with Angular 2 - the perfect match
Christoffer Noring, OVO Energy / London, England
27 Nov. 2016 · 4:05 p.m.
Q&A - Firebase with Angular 2 - the perfect match
Christoffer Noring, OVO Energy / London, England
27 Nov. 2016 · 4:33 p.m.
Wanna more fire? - Let's try polymerfire!
Sofiya Huts, JustAnswer / Lviv, Ukraine
27 Nov. 2016 · 5 p.m.
Q&A - Wanna more fire? - Let's try polymerfire!
Sofiya Huts, JustAnswer / Lviv, Ukraine
27 Nov. 2016 · 5:38 p.m.
Closing Remarks
27 Nov. 2016 · 5:44 p.m.

Recommended talks

Q&A: Keynote - Reproducibility and Open Science @ EPFL
Pierre Vandergheynst, EPFL VP for Education
24 March 2017 · 9:54 a.m.