0% found this document useful (0 votes)
15 views22 pages

Optimization Story

Uploaded by

scribd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views22 pages

Optimization Story

Uploaded by

scribd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

An Optimization Story

László Bácsi lackac


Secret Sauce Partners, Inc.

13. október 2., szerda


13. október 2., szerda
DON’T!

13. október 2., szerda


OPTIMIZE

SMARTLY
13. október 2., szerda
Why optimize?

13. október 2., szerda


Why optimize?

13. október 2., szerda


Why optimize?

13. október 2., szerda


Why optimize?

13. október 2., szerda


DAILY JOBS API

13. október 2., szerda


The Ideas

• Don’t update unnecessarily


• Don’t pre-calculate stuff we would
recalculate anyway
• Schema change – extract embedded

13. október 2., szerda


The Process

1. Measure baseline
2. Implement an idea
3. Measure performance improvement
4. Repeat

13. október 2., szerda


The Bonus

• 1+n queries, caching with IdentityMap


• Don’t GC during a job (dangerous)
• GC optimizations

13. október 2., szerda


The Tools

• New Relic RPM


• GC::[Link]
• Ruby 2.0

13. október 2., szerda


THE RESULTS

13. október 2., szerda


13. október 2., szerda
down from 5s+

13. október 2., szerda


13. október 2., szerda
down from 1000+

13. október 2., szerda


UpdateCustomers job

13. október 2., szerda


13. október 2., szerda
Conclusions

• Never optimize prematurely


• Measure
• Monitor

13. október 2., szerda


Thanks! Questions?

SSP we’re hiring!


13. október 2., szerda

You might also like