web performance

Post on 05-Jul-2015

310 Views

Category:

Technology

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

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

TRANSCRIPT

Web PerformanceOptimization

Agenda

• What?

• Why?

• How?

What?

What does it looks like?

Long and Hard Journey

Q: what’s the trip destination?

• Palo Alto ?

• CDC ?

• Sweden?

• Indian ?

Why?

Most compilers in most programmer

languages does these optimizations

for you, but not JavaScript.

Language Level

Structure Level

Requirement and Design change, some

time need restructure and redesign our

Program .

Coding Level

Developer skills are difference, implement

ways are different, but just one way is the

best.

The most Important one:

Improve User Experience, make user happy.

How?

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.

Correctness First

• Correctness First, then do optimize

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

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

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 };

Suitable Operation Interface

with Back-end

Why big dataat one time?

Dat

a si

ze

Request

response

1 2

If necessary , don’t forgetusing

XSLT process big XML data

Don't Optimize Without Measuring

Only speed up things that take a lot of time.

A B C D

Avoid unnecessary repaint

TODO

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)

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.

Questions?

What’s the destination of our

long and hard journey?

About Author

• Name: Major

• Email: major.yezhouquan@gmail.com

• City: Beijing / China

Thanks

top related