27
Web Performance Optimization

Web performance

Embed Size (px)

DESCRIPTION

what's thing we should think about during the performance journey . Major help you to solve these problem .

Citation preview

Page 1: Web  performance

Web PerformanceOptimization

Page 2: Web  performance

Agenda

• What?

• Why?

• How?

Page 3: Web  performance

What?

What does it looks like?

Page 4: Web  performance

Long and Hard Journey

Page 5: Web  performance

Q: what’s the trip destination?

• Palo Alto ?

• CDC ?

• Sweden?

• Indian ?

Page 6: Web  performance

Why?

Page 7: Web  performance

Most compilers in most programmer

languages does these optimizations

for you, but not JavaScript.

Language Level

Page 8: Web  performance

Structure Level

Requirement and Design change, some

time need restructure and redesign our

Program .

Page 9: Web  performance

Coding Level

Developer skills are difference, implement

ways are different, but just one way is the

best.

Page 10: Web  performance

The most Important one:

Improve User Experience, make user happy.

Page 11: Web  performance

How?

Page 12: Web  performance

Structure meet the requirement

Suggestion:

When we design the structure , we should think about the data size, if the at the beginning of the project, the spec could provide some information of data size we should support, like min / max data size, that

could help us more.

Page 13: Web  performance

Correctness First

• Correctness First, then do optimize

• Test Performance early(when coding, don’t forget the performance)

• More Testing (Different Browser IE8, FF3/4)

Page 14: Web  performance

When server response slow, what’s the first thing we think

about?

• Server Slow?

• Request parameters too much?var objParams = {

ids: cb.args()[0], paramQueryParams: { retrieveParamGroups: true,

retrieveParams: true, objGroupQueryParams: {

retrieveObjectGroups: true, retrieveObjectGroupMembers: true

} }, retrieveTags: true };

Page 15: Web  performance

Suitable Operation Interface

with Back-end

Page 16: Web  performance

Why big dataat one time?

Page 17: Web  performance

Dat

a si

ze

Request

response

1 2

Page 18: Web  performance

If necessary , don’t forgetusing

XSLT process big XML data

Page 19: Web  performance

Don't Optimize Without Measuring

Page 20: Web  performance

Only speed up things that take a lot of time.

A B C D

Page 21: Web  performance

Avoid unnecessary repaint

Page 22: Web  performance

TODO

Page 23: Web  performance

Code Quality

• High quality code is mostly likely to avoid platform problems.

• Code Conventions for the JavaScript Programming Language

• http://javascript.crockford.com/code.html

• Use JSLint.com. Pass with no warnings.

• Coder refractor

(https://github.com/kangax/kratko.js)

Page 24: Web  performance

Have regular code readings.

• Don’t wait until release to do code reviews.

• Do team code reading regularly during development.

• Experienced developers can lead by example.

• Novice developers learn from the group.

• Problems can be discovered early.

• Good techniques can be shared early.

Page 25: Web  performance

Questions?

What’s the destination of our

long and hard journey?

Page 26: Web  performance

About Author

• Name: Major

• Email: [email protected]

• City: Beijing / China

Page 27: Web  performance

Thanks