this presentation uses the following non-standard fonts ... · bin ulizaon 2.3% 0 50 100 150 0 50...

114
This presentation uses the following non-standard fonts: Lato (http://www.latofonts.com/lato-free-fonts/) FontAwesome (https://fortawesome.github.io/Font-Awesome/) You will need to download and install the TTF versions of these fonts for the slides to work correctly. A PDF version with embedded fonts is available at http:// www.cs.grinnell.edu/~curtsinger/

Upload: others

Post on 11-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

This presentation uses the following non-standard fonts:

Lato (http://www.latofonts.com/lato-free-fonts/)FontAwesome (https://fortawesome.github.io/Font-Awesome/)

You will need to download and install the TTF versions of these fonts for the slides to work correctly. A PDF version with embedded fonts is available at http://www.cs.grinnell.edu/~curtsinger/

Page 2: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G EG R I N N E L LC O L L E G E

The Grinnell College LogoBelow is the Grinnell College logo in its threeacceptable variations. The type and laural leavesshould always be used together in one of theseconfigurations. The top logo is our main mark. Theother two styles were developed for use ininstances where enough horizontal space is notavailable to accomodate the preferred art.

Color combinations:• Black type with Pantone 485 red laurel leaves• Black type with black laurel leaves

If reversed out of a color:• White type with white laurel leaves• White type with Pantone 485 red laurel leaves

(only if reversed out of black)

The same color combinations apply to all threeacceptable variations on the logo.

The version with two lines of type is intended foruse at very small sizes, i.e., lapel pin

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G EG R I N N E L LC O L L E G E

The Grinnell College LogoBelow is the Grinnell College logo in its threeacceptable variations. The type and laural leavesshould always be used together in one of theseconfigurations. The top logo is our main mark. Theother two styles were developed for use ininstances where enough horizontal space is notavailable to accomodate the preferred art.

Color combinations:• Black type with Pantone 485 red laurel leaves• Black type with black laurel leaves

If reversed out of a color:• White type with white laurel leaves• White type with Pantone 485 red laurel leaves

(only if reversed out of black)

The same color combinations apply to all threeacceptable variations on the logo.

The version with two lines of type is intended foruse at very small sizes, i.e., lapel pin

Coz: Finding Code that Counts with Causal Profiling

Charlie Curtsinger Emery D. Berger

Page 3: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

A few months ago, in a valley not so far away…

Page 4: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

This is Bob. Bob has an ideafor a startup.

Page 5: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions
Page 6: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

found 8,000,000similar images

It’s going to totally disrupt image search.

glegle

Page 7: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

glegle

glegle

found 8,000,000similar images

Take a pictureAdd it to

the database

Send results Find similar pictures

Send it to Ogle

The Prototype

Page 8: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

! "

# $ %

found 8,000,000similar images

Send results Find similar pictures

Page 9: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

! "

# $ &

'

'

&

%

found 8,000,000similar images

Send results Find similar pictures

Page 10: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

glegle

glegleglegle glegle glegle glegle glegle glegle glegle glegle glegle

Ogle is totally disrupBng image search.

Page 11: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

glegle

loading…

Ogle is too slow!

Page 12: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

! "

# $ %

SoCware Profilers

% cumulative time seconds calls name 20.05 8.02 1 ! 9.56 3.82 1 " 19.95 7.98 1 # 45.19 11.31 1 $

5.25 2.10 1 %

Number of callsto each func8on

Run8me for each func8on

Page 13: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

! "

# $ %

SoCware Profilers

% cumulative time seconds calls name 20.05 8.02 1 ! 9.56 3.82 1 " 19.95 7.98 1 # 45.19 11.31 1 $

5.25 2.10 1 %

Frequently executed code

Code that runs for a long 8me

Are these places where Bobshould focus on performance?

Page 14: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Would this speed up Ogle?

glegle

loading…

glegle

loading…

Page 15: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Would this speed up Ogle?

glegle

loading…

Frequently executed codeCode that runs for a long 8me

Profilers do a bad job finding important code in parallel programs.

We need beEer tools.

Page 16: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

What would speed up Ogle?

! "

# $ %

Hey, look over here

What would this informa8on look like?

Page 17: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Prog

ram

Spe

edup

Speedup?

$

#

!

Causal ProfileTells you where opBmizaBons

will make a difference

Page 18: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Prog

ram

Spe

edup

Speedup?

$

#

!

Causal Profile

If you speed up this much #

The program will run this much faster

Page 19: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Prog

ram

Spe

edup

Speedup?

$

#

!

Causal Profile

this change

Run an experiment

How do we know

causes this effect?

Page 20: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

$

! "

# $ %

Performance Experiments

&

'

'

&

If we could magically speed up …$

Page 21: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

$

! "

# $ %

Performance Experiments

&

'

'

&

If we could magically speed up …$

Speeding up by this much…$

speeds up the program by this much.

Page 22: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

$

! "

# $ %

Performance Experiments

&

'

'

&

If we could magically speed up …$

More speedup in …$

leads to a larger program speedup.

Page 23: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

"! "

# $ %

Performance Experiments

&

'

'

&

If we could magically speed up …"

Page 24: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

"! "

# $ %

Performance Experiments

&

'

'

&

If we could magically speed up …"

No program speedup

Page 25: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

! "

# $

Performance Experiments

&

'

'

&

We’re going to have to do this without magic.

%

Page 26: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

! "

# $ %

Performance Experiments

&

'

'

&

We’re going to have to do this without magic.

Otherwise we’d just do this.

Page 27: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

“Speed up” by slowing everything else down.%

! "

# $ %&

'

'

&

Each Bme runs, pause all other threads.%

%

Page 28: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

“Speed up” by slowing everything else down.%

! "

# $ &

'

'

&

Each Bme runs, pause all other threads.%

%

Page 29: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

“Speed up” by slowing everything else down.%

! "

# $ &

'

'

&

%

To account for the size of the delay…

Page 30: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

“Speed up” by slowing everything else down.%

! "

# $ &

'

'

&

%

Speeding up by this much…%

speeds up the program by this much.

Page 31: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Prog

ram

Spe

edup

Speedup?

Speedup Results

Page 32: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

%

Prog

ram

Spe

edup

Speedup?

Speedup Results

Page 33: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

“Speed up” by slowing everything else down.%

! "

# $ &

'

'

&

%

Page 34: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

“Speed up” by slowing everything else down.%

! "

# $ &

'

'

&

%

A larger speedup has no addiBonal effect

Page 35: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

%

Prog

ram

Spe

edup

Speedup?

Speedup Results

Page 36: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

%

Prog

ram

Spe

edup

Speedup?

Speedup Results

Page 37: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

“Speed up” by slowing everything else down.#

! "

# $ %&

'

'

&

Each Bme runs, pause all other threads.#

%

Page 38: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

“Speed up” by slowing everything else down.#

! "

# $ %&

'

'

&

Each Bme runs, pause all other threads.#

%

Page 39: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

“Speed up” by slowing everything else down.#

! "

# $ %&

'

'

&

Each Bme runs, pause all other threads.#

%

Page 40: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

%

Prog

ram

Spe

edup

Speedup?

Speedup Results

Page 41: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

%

Prog

ram

Spe

edup

Speedup?

Speedup Results

#

Page 42: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

%

Prog

ram

Spe

edup

Speedup?

Speedup Results

#

Page 43: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

“Speed up” by slowing everything else down.!

"

# $ %&

'

'

&

Each Bme runs, pause all other threads.!

%

!

Page 44: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

! "

# $ %&

'

'

&

%

“Speed up” by slowing everything else down.!

Each Bme runs, pause all other threads.!

Page 45: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

! "

# $ %&

'

'

&

%

“Speed up” by slowing everything else down.!

Each Bme runs, pause all other threads.!

Page 46: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

%

Prog

ram

Spe

edup

Speedup?

Speedup Results

#

Page 47: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

%

Prog

ram

Spe

edup

Speedup?

Speedup Results

#

!

Page 48: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

! "

# $ %&

'

'

&

%

“Speed up” by slowing everything else down.!

Each Bme runs, pause all other threads.!

Page 49: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

!

# %$ &'

"' &

%

“Speed up” by slowing everything else down.!

Each Bme runs, pause all other threads.!

Page 50: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

!

# $ &'

"' &

%

“Speed up” by slowing everything else down.!

Each Bme runs, pause all other threads.!

Page 51: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

!

# $ &'

"' &

%

“Speed up” by slowing everything else down.!

Each Bme runs, pause all other threads.!

Page 52: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

%

Prog

ram

Spe

edup

Speedup?

Speedup Results

#

!

Page 53: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

%

Prog

ram

Spe

edup

Speedup?

Speedup Results

#

!

Speeding up slows the program down!!

Page 54: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

!

# $ &'

"' &

%

“Speed up” by slowing everything else down.!

Each Bme runs, pause all other threads.!

Page 55: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup

!

# $ &'

"' &

%

“Speed up” by slowing everything else down.!

Each Bme runs, pause all other threads.!

Page 56: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

0

%

Prog

ram

Spe

edup

Speedup?

Speedup Results

#

!

Page 57: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

0

%

Prog

ram

Spe

edup

Speedup?

Speedup Results

#

!

Page 58: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

0

%

Prog

ram

Spe

edup

Speedup?

Speedup Results

#

!

Page 59: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

0

%

Prog

ram

Spe

edup

Speedup?

Speedup Results

#

!

"

$

Page 60: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Is runOme meaningful?

glegle

found 8,000,000similar images

Take a pictureAdd it to

the database

Send results Find similar pictures

Send it to Ogle

glegle

Page 61: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Is runOme meaningful?

glegle

found 8,000,000similar images

glegle

How fast do results come back?

How long betweenrequest and response?

Page 62: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Progress Points

! "

# $ %&

'

'

&

%

Bob wants to send responses faster.

Each 8me this code runs…He marks as a progress point.%

Page 63: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

" &

" &

" &

" &

Progress Points

!

Many requests running for many users.

! '

!

# $ &

'

' %

!

# $ &

'

' %

!

# $'

!

# $ &

'

' %

Page 64: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

" &

" &

" &

Progress Points

!

# $ &

'

' %

!

# $ &

'

' %

!

# $'

!

# $ &

'

' %

One progress point measures throughput.

If I speed up , how much faster do I run ?? %

Page 65: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Progress Points

! "

# $ %&

'

'

&

Bob wants to minimize response Bme.He adds latency progress points.

transactions++ transactions--

Page 66: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Progress Points

! "

# $ %&

'

'

&

Bob wants to minimize response Bme.He adds latency progress points.

transactions++ transactions--

Little’s Law: W= L / λ

latency = transactions / throughput

Page 67: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Coz: a Causal Profiler for Linux

>> coz run --- ./ogle_server deploy

Page 68: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Coz Produces Causal Profiles

%

Prog

ram

Spe

edup

Speedup?

#

!

"

$

Let’s use it to improve Ogle

Page 69: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Using Causal Profiling on Ogle

glegle

found 8,000,000similar images

Page 70: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Using Causal Profiling on Ogle

dedupcompression

ferretimage comparison

Page 71: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Ferret

input output

segmentaOon feature extracOon indexing ranking

image comparison

Page 72: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

●● ●

●●

● ● ●

● ●

●●

●●

0%

25%

50%

75%

100%

0%

25%

50%

75%

100%

0%

25%

50%

75%

100%

line 320line 358

line 255

0% 25% 50% 75% 100%Line Speedup

Prog

ram

Spe

edup

Line ● line 320 line 358 line 255

ranking

indexing

segmentaOon

Ferret

Page 73: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Ferret

input output

segmentaOon feature extracOon indexing ranking

Page 74: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Ferret

input output

segmentaOon feature extracOon indexing ranking

Probably doesn’t need as many threads

Page 75: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Ferret

input output

segmentaOon feature extracOon indexing ranking

21% Speedup

Page 76: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

ranking

What did Causal Profiling predict?

Increased from 16 to 22 threads

27% increase in ranking throughput

Page 77: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

●● ●

●●

● ● ●

● ●

●●

●●

0%

25%

50%

75%

100%

0%

25%

50%

75%

100%

0%

25%

50%

75%

100%

line 320line 358

line 2550% 25% 50% 75% 100%

Line Speedup

Prog

ram

Spe

edup

Line ● line 320 line 358 line 255

●● ●

●●

● ● ●

● ●

●●

●●

0%

25%

50%

75%

100%

0%

25%

50%

75%

100%

0%

25%

50%

75%

100%

line 320line 358

line 255

0% 25% 50% 75% 100%Line Speedup

Prog

ram

Spe

edup

Line ● line 320 line 358 line 255

ranking

Exactly what we observed

What did Causal Profiling predict?

27% increase in ranking throughputCausal Profiling predicted a 21% improvement

Page 78: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Using Causal Profiling on Ogle

dedupcompression

ferretimage comparison

Page 79: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

DedupCompression via deduplicaBon

Page 80: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

DedupCompression via deduplicaBon

Page 81: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

DedupCompression via deduplicaBon

grumpycat1.jpg funisawful.jpg

Page 82: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

DedupCompression via deduplicaBon

hash_function( )i =

Page 83: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

hash_function( )

DedupCompression via deduplicaBon

i =

Page 84: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

DedupCompression via deduplicaBon

i = hash_function( )

Page 85: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

DedupCompression via deduplicaBon

i = hash_function( )

Page 86: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

DedupCompression via deduplicaBon

i = hash_function( )

Page 87: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

DedupCompression via deduplicaBon

i = hash_function( )

Page 88: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

DedupCompression via deduplicaBon

' ' ' ' ' '

Hash table is accessed concurrently by many threads

Causal Profiler says the loop that accesses this

list is important

Page 89: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

DedupCompression via deduplicaBon

' ' ' ' ' '

More hash buckets should lead to fewer collisions

' ' ' ' ' '

Page 90: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

DedupCompression via deduplicaBon

' ' ' ' ' '

More hash buckets should lead to fewer collisions

' ' ' ' ' '

Page 91: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

DedupCompression via deduplicaBon

' ' ' ' ' '

More hash buckets should lead to fewer collisions

' ' ' ' ' '

No performance improvement

Page 92: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

DedupCompression via deduplicaBon

' ' ' ' ' ' ' ' ' ' ' '

What else could be causing collisions?

i = hash_function( )

Page 93: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Horrible hash func8on!Bin UBlizaBon

2.3%0

50

100

150

0

50

100

150

Original Version

After O

ptimization

0 250 500 750 1000Bucket Index

Colli

sions

0

50

100

150

0

50

100

150

Original Version

After O

ptimization

0 250 500 750 1000Bucket Index

Colli

sions

Item

s pe

r-bu

cket

DedupCompression via deduplicaBon

Page 94: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Bin UBlizaBon

2.3%0

50

100

150

0

50

100

150

Original Version

After O

ptimization

0 250 500 750 1000Bucket Index

Colli

sions

82%

0

50

100

150

0

50

100

150

Original Version

After O

ptimization

0 250 500 750 1000Bucket Index

Col

lisio

ns

0

50

100

150

0

50

100

150

Original Version

After O

ptimization

0 250 500 750 1000Bucket Index

Colli

sions

9% SpeedupItem

s pe

r-bu

cket

Compression via deduplicaBonDedup

Page 95: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

What did Causal Profiling predict?

Before: 76.7

ACer: 2.09

Blocks per-bucket

DedupCompression via deduplicaBon

96% traversal speedup

9% predicted speedup,exactly what we observed

Page 96: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Using Causal Profiling on Ogle

dedupcompression

ferretimage comparison

Page 97: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Simple SQL Database

#if THREAD_SAFE config_t global_config = { … .unlock = pthread_mutex_unlock, .getsize = sqlite_usable_size, .nextitem = sqlite_pagecache_next, … }; #endif

Page 98: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Simple SQL Database

#if THREAD_SAFE config_t global_config = { … .unlock = pthread_mutex_unlock, .getsize = sqlite_usable_size, .nextitem = sqlite_pagecache_next, … }; #endif

void pthreadMutexLeave(lock* l) { global_config.unlock(l); }

Indirect CallCheap, but almost the same cost

as pthread_mutex_unlock

Page 99: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Simple SQL Database

void pthreadMutexLeave(lock* l) { global_config.unlock(l); }

void sqlite3MemSize(void* p) { global_config.getsize(p); }

void pcache1Fetch(item* i) { global_config.nextitem(i); }

Coz highlights these lines

Page 100: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Simple SQL Database

●●

●●

● ●

Line 16916 Line 18974 Line 40345

−50%

−25%

0%

25%

0% 50% 0% 50% 0% 50%Line Speedup

Prog

ram

Spe

edup

Page 101: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Simple SQL Database

void pthreadMutexUnlock(lock* l) { global_config.unlock(l); }

void sqlite3MemSize(void* p) { global_config.getsize(p); }

void pcache1Fetch(item* i) { global_config.nextitem(i); }

Page 102: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Simple SQL Database

void pthreadMutexUnlock(lock* l) { pthread_mutex_unlock(l); }

void sqlite3MemSize(void* p) { sqlite_usable_size(p); }

void pcache1Fetch(item* i) { sqlite_pagecache_next(i); } 25% Speedup

Page 103: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

void sqlite_unlock(lock* l) {

What do other profilers say?% Runtime Symbol 85.55% _raw_spin_lock 1.76% x86_pmu_enable_all

... 30 lines …

0.10% rcu_irq_enter 0.09% sqlite3MemSize 0.09% source_load

... 26 lines …

0.03% __queue_work 0.03% pcache1Fetch 0.03% kmem_cache_free 0.03% update_cfs_rq_blocked_load 0.03% pthreadMutexLeave 0.03% sqlite3MemMalloc

Just 0.15% oftotal runOme

Page 104: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Using Causal Profiling on Ogle

dedupcompression

ferretimage comparison

25%

9%

21%

0.15%

14.38%

0.00%

speedupwith Coz % run8me

(whole func,on)

Page 105: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Summary of OpOmizaOons

Benchmark Speedup Diff Size Change Summary

memcached 9.39% -6, +2 removed unnecessary locks

sqlite 25.60% -3, +3 removed DIY vtable implementaBon

blackscholes 2.56% -61, +4 manual common subexpression eliminaBon

dedup 8.95% -3, +3 fixed degenerate hash funcBon

ferret 21.27% -4, +4 rebalanced pipeline thread allocaBon

fluidanimate 37.50% -1, +0 removed custom barrier with high contenBon

streamcluster 68.40% -1, +0 removed custom barrier with high contenBon

swapOons 15.80% -10, +16 reordered loop nests

Page 106: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

glegle

loading…

% cumulative time seconds calls name 20.05 8.02 1 ! 9.56 3.82 1 " 19.95 7.98 1 # 45.19 11.31 1 $

5.25 2.10 1 %

Page 107: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

glegle

loading…

% cumulative time seconds calls name 20.05 8.02 1 ! 9.56 3.82 1 " 19.95 7.98 1 # 45.19 11.31 1 $

5.25 2.10 1 %

! "

# $ %&

'

'

&

%

Page 108: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

" &

glegle

loading…

% cumulative time seconds calls name 20.05 8.02 1 ! 9.56 3.82 1 " 19.95 7.98 1 # 45.19 11.31 1 $

5.25 2.10 1 %

!

# $ %&

'

' %

Page 109: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G EG R I N N E L LC O L L E G E

The Grinnell College LogoBelow is the Grinnell College logo in its threeacceptable variations. The type and laural leavesshould always be used together in one of theseconfigurations. The top logo is our main mark. Theother two styles were developed for use ininstances where enough horizontal space is notavailable to accomodate the preferred art.

Color combinations:• Black type with Pantone 485 red laurel leaves• Black type with black laurel leaves

If reversed out of a color:• White type with white laurel leaves• White type with Pantone 485 red laurel leaves

(only if reversed out of black)

The same color combinations apply to all threeacceptable variations on the logo.

The version with two lines of type is intended foruse at very small sizes, i.e., lapel pin

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G EG R I N N E L LC O L L E G E

The Grinnell College LogoBelow is the Grinnell College logo in its threeacceptable variations. The type and laural leavesshould always be used together in one of theseconfigurations. The top logo is our main mark. Theother two styles were developed for use ininstances where enough horizontal space is notavailable to accomodate the preferred art.

Color combinations:• Black type with Pantone 485 red laurel leaves• Black type with black laurel leaves

If reversed out of a color:• White type with white laurel leaves• White type with Pantone 485 red laurel leaves

(only if reversed out of black)

The same color combinations apply to all threeacceptable variations on the logo.

The version with two lines of type is intended foruse at very small sizes, i.e., lapel pin

This is the profiler you are looking for.coz-profiler.org

Page 110: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G EG R I N N E L LC O L L E G E

The Grinnell College LogoBelow is the Grinnell College logo in its threeacceptable variations. The type and laural leavesshould always be used together in one of theseconfigurations. The top logo is our main mark. Theother two styles were developed for use ininstances where enough horizontal space is notavailable to accomodate the preferred art.

Color combinations:• Black type with Pantone 485 red laurel leaves• Black type with black laurel leaves

If reversed out of a color:• White type with white laurel leaves• White type with Pantone 485 red laurel leaves

(only if reversed out of black)

The same color combinations apply to all threeacceptable variations on the logo.

The version with two lines of type is intended foruse at very small sizes, i.e., lapel pin

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G E

G R I N N E L L C O L L E G EG R I N N E L LC O L L E G E

The Grinnell College LogoBelow is the Grinnell College logo in its threeacceptable variations. The type and laural leavesshould always be used together in one of theseconfigurations. The top logo is our main mark. Theother two styles were developed for use ininstances where enough horizontal space is notavailable to accomodate the preferred art.

Color combinations:• Black type with Pantone 485 red laurel leaves• Black type with black laurel leaves

If reversed out of a color:• White type with white laurel leaves• White type with Pantone 485 red laurel leaves

(only if reversed out of black)

The same color combinations apply to all threeacceptable variations on the logo.

The version with two lines of type is intended foruse at very small sizes, i.e., lapel pin

This is the profiler you are looking for.coz-profiler.org

Page 111: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

0%

20%

40%

60%

blacks

choles

body

track

cannea

lded

up

facesi

mfer

ret

fluida

nimate

freqm

ine

raytra

ce

stream

cluste

r

swapt

ions

vips

x264

mean

Benchmark

Perc

ent O

verh

ead

Delays Sampling Startup

Overhead of COZ

Page 112: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup AccuracyV

irtua

l Pro

gram

Spe

edup

-75%

-50%

-25%

0%

25%

50%

Real Program Speedup-75% -50% -25% 0% 25% 50%

Parallel compression program pbzip2

The program speedup we get fromactually speeding up a piece of code

Page 113: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup AccuracyV

irtua

l Pro

gram

Spe

edup

-75%

-50%

-25%

0%

25%

50%

Real Program Speedup-75% -50% -25% 0% 25% 50%

Parallel compression program pbzip2

The program speedup we get fromvirtually speeding up the same code.

Page 114: This presentation uses the following non-standard fonts ... · Bin Ulizaon 2.3% 0 50 100 150 0 50 100 150 Original Version After Optimization 0 250 500 750 1000 Bucket Index Collisions

Virtual Speedup AccuracyV

irtua

l Pro

gram

Spe

edup

-75%

-50%

-25%

0%

25%

50%

Real Program Speedup-75% -50% -25% 0% 25% 50%

Parallel compression program pbzip2

Causal Profiling’s predic8ons closely match reality

The program ran faster withthe slow version of this code!