How to make your apps more efficient

  • Published on
    12-Apr-2017

  • View
    318

  • Download
    2

Transcript

Application Efficiency

How can you make your apps more efficient ?

By: ankit.json@gmail.com

Four rules of code efficiency

First, do no harm

You don't know what the problem is until you measure it

Whats under your control

Always look for the easy win

Efficiency Areas

MEMORY

DISK , FILE I/O

NETWORK I/O

ALGORITHMIC EFFICIENCY

MEMORY

Make efficient use of system memory

Prevent large swapping files

Memory is cheap, users are not

Prevent memory leaks

Measure memory usage of your applications

DISK I/O

Make efficient usage of disk storage

Make usage of faster storage mechanisms such as ssd, net storage

Monitor your apps disk i/o and ways to optimize it

You can reduce disk i/o to make your apps more faster

Network I/O

Make lesser number of network calls

Compress the network calls in formats such as gzip

Reduce comments, blank spaces, optimize resources on network

More network I/O means more cost

Monitor your apps network I/O

Cache similar network i/o requests

Algorithmic Efficiency

Use languages inbuilt functions for doing complex tasks rather than building your own from scratch, eg: sorting

Make efficient use of data types, data structures, memory allocation

Make efficient use of loops & recursion

Take a sample code and think how can you make it more efficient without having any effect on its output

PRECAUTION

Making changes for efficiency which has no noticable efficieny gains on user experience on user expericnce is bullshit.

You are trying to make button click faster, without noticing this thing has no effect on user experience.