SlideShare a Scribd company logo
1 of 41
Download to read offline
Open Source at Scale
1
Garrett Moon

OSCON, July 23rd, 2015
Building Pinterest’s iOS App
Open Source at Scale
2
Garrett Moon

OSCON, July 23rd, 2015
Building Pinterest’s iOS App
3
Dependencies
Shipping
Bugs
Images
4
Dependencies
Shipping
Bugs
Images
Why We Use Open Source
5
Scale
Pinterest has significantly fewer iOS engineers than Facebook
1
Speed
Move quickly from prototype to production
2
Reliability
Open source projects are often old and well tested
3
Open Source At Pinterest
7
Over 15 open source projects

Pinball: A scalable workflow manager

Secor: A service implementing Kafka log persistence

PINCache: Fast non-deadlocking parallel object cache for iOS and OS X
Open Source on iOS
• AFNetworking
• PINCache
• PINRemoteImage
• FLAnimatedImage
• Kingpin
• Masonry
• AsyncDisplayKit
• Pop
• Realm
Just some of the great projects we use
8
2:50 PM 100%
9
target 'PINRemoteImage', :exclusive => true do
pod "PINRemoteImage", :path => "../"
pod "PINCache", '2.0'
pod "libwebp"
end
target 'PINRemoteImage Tests', :exclusive => true
do
pod "PINRemoteImage", :path => "../"
end
Package Management
with CocoaPods
Specify version numbers.
Run `pod outdated` regularly.
10
Dependencies
Shipping
Bugs
Images
No second
chances
Shipping iOS apps is like
shipping packaged
software.
11
Ship Frequently & Regularly
Monday Tuesday Wednesday Thursday Friday
START
Ship Frequently & Regularly
Monday Tuesday Wednesday Thursday Friday
START CODE
CODE CODE CODE CODE CODE
CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE
> P1 BUGS > P1 BUGS SUBMIT
Ship Frequently & Regularly
Monday Tuesday Wednesday Thursday Friday
START CODE
CODE CODE CODE CODE CODE
CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE
> P1 BUGS > P1 BUGS SUBMIT WAIT WAIT
WAIT WAIT WAIT SHIP
Ship Frequently & Regularly
Monday Tuesday Wednesday Thursday Friday
START CODE
CODE CODE CODE CODE CODE
CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE
> P1 BUGS > P1 BUGS SUBMIT START CODE
CODE CODE CODE SHIP CODE
CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE
Ship Frequently & Regularly
Monday Tuesday Wednesday Thursday Friday
> P1 BUGS > P1 BUGS SUBMIT START CODE
CODE CODE CODE CODE CODE
CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE
> P1 BUGS > P1 BUGS SUBMIT START CODE
CODE CODE CODE SHIP CODE
CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE
Ship Frequently & Regularly
Monday Tuesday Wednesday Thursday Friday
> P1 BUGS > P1 BUGS SUBMIT START CODE
CODE CODE CODE CODE CODE
CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE
> P1 BUGS > P1 BUGS SUBMIT START CODE
CODE CODE CODE SHIP CODE
CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE
P1 > BUGS P1 > BUGS SUBMIT START CODE
CODE CODE CODE SHIP CODE
CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE
> P1 BUGS > P1 BUGS SUBMIT
18
Dependencies
Shipping
Bugs
Images
Crashes
Crash Reporting
• Helps diagnose and fix issues from previous
releases
• Users affected
• Sessions affected
• Devices affected
Tools
• NSZombies
• Leaks
• Address Sanitizer
19
20
Testing
Continuous Testing
• Unit tests around processing code and
models
• Continuous Integration testing around
core library interactions
• UI Automation tests around core flows
User Testing
• Nightly internal builds for all employees
• Small contracted team does user testing
nightly
• Core team tests rigorously before release
Deadlocks
• Possibly stuck in a loop
• Probably blocked waiting on another thread
• Sometimes caused by a corrupted UI
• Thread explosion when using queues as
locks
• Dogfood with a deadlock detector
21
Thread explosion
The dark side of using a serial queue as a lock
22
Main Thread Serial Queue
Create a threadx100
waiting…
waiting…
Concurrent Queue
Deadlocks
• Possibly stuck in a loop
• Probably blocked waiting on another thread
• Sometimes caused by a corrupted UI
• Thread explosion when using queues as
locks
• Dogfood with a deadlock detector
23
Monitoring
• Log everything
• API requests
• Client side usage
• Performance
• Monitor to spot problems
• App Store ratings
• Crash rates
• Usage metrics
24
Experimenting
• Everything is an experiment
• Short and long term analyses
• You are the only one desperate for your new
feature
25
Automation
• OTA builds
• Unit, integration and UI tests
• Performance tests
• Linters
26
27
Dependencies
Shipping
Bugs
Images
Pinterest mobile users download hundreds of images per day.
Introducing PINRemoteImage
29
A thread safe, performant, feature rich image fetcher
PINRemoteImage
• Image downloading (obviously)
• Image caching (on disk and in memory)
• De-duping image downloads
• Setting download and processing priority
• Prefetching images
• Image decompression off the main thread
A thread safe, performant, feature rich image fetcher
30
Multi-format Support
• JPEG
• Progressive decoding
• PNG
• WebP
• FLAnimatedImage
Supports downloading a variety of
formats:
31
32
Animated GIFs
Supported by FLAnimatedImage
FLAnimatedImageView *animatedImageView = [[FLAnimatedImageView alloc] init];
[animatedImageView setImageFromURL:
[NSURL URLWithString:@"http://pinterest.com/flyingKitten.gif"]];
Progressive JPEG
With an attractive blur
33
A mother with her son
Dejan Muazer
Cats
1
A mother with her son
Dejan Muazer
Cats
2
A mother with her son
Dejan Muazer
Cats
3
A mother with her son
Dejan Muazer
Cats
4
34
Progressive JPEG
With an attractive blur
UIImageView *imageView = [[UIImageView alloc] init];
[imageView setUpdateWithProgress:YES];
[imageView setImageFromURL:
[NSURL URLWithString:@"http://pinterest.com/progressiveKitten.jpg"]];
Adaptable Quality Downloading
Download varying quality images based on network conditions
Confidential 35Source: Placeholder Numbers
2:50 PM 100%
50 Kbps
2:50 PM 100%
100 Kbps
2:50 PM 100%
200 Kbps
Adaptive Quality Downloading
36
Download varying quality images based on network conditions
UIImageView *imageView = [[UIImageView alloc] init];
[imageView setImageFromURLs:
@[[NSURL URLWithString:@"http://pinterest.com/lowQualityKitten.webp"],
[NSURL URLWithString:@"http://pinterest.com/mediumQualityKitten.webp"],
[NSURL URLWithString:@"http://pinterest.com/highQualityKitten.webp"]]];
[[PINRemoteImageManager sharedImageManager] setShouldUpgradeLowQualityImages:YES completion:nil];
Image Processing
With an easy to write processing block
37
Image Processing
With an easy to write processing block
38
[self.imageView setImageFromURL:
[NSURL URLWithString:@"http://pinterest.com/kitten-image.jpg"]
processorKey:@"rounded" processor:^UIImage *(PINRemoteImageManagerResult *result, NSUInteger *cost)
{
UIGraphicsBeginImageContext(result.image.size);
//add rounded clip
[result.image drawInRect:drawRect];
UIImage *processedImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return processedImage;
}];
How it works
39
Whiskers
Download Kitten 1
Round Kitten 1
Round Kitten 1
Download
Round Kitten 1
Round Kitten 1
Process
Round Kitten 2
Download
Round Kitten 2
Process
MEOW.
MEOW.
MEOW.
PINRemoteImage
40
https://github.com/Pinterest/PINRemoteImage
Available now:
41
garrett@pinterest.com
pinterest.com/garrettlunar
@garrettmoon
https://github.com/Pinterest/PINRemoteImage

More Related Content

What's hot

Philly CocoaHeads 20160414 - Building Your App SDK With Swift
Philly CocoaHeads 20160414 - Building Your App SDK With SwiftPhilly CocoaHeads 20160414 - Building Your App SDK With Swift
Philly CocoaHeads 20160414 - Building Your App SDK With SwiftJordan Yaker
 
Continous integration and delivery for single page applications
Continous integration and delivery for single page applicationsContinous integration and delivery for single page applications
Continous integration and delivery for single page applicationsSunil Dalal
 
Cross platform native development with appcelerator titanium (2014 devnexus)
Cross platform native development with appcelerator titanium (2014 devnexus)Cross platform native development with appcelerator titanium (2014 devnexus)
Cross platform native development with appcelerator titanium (2014 devnexus)Stephen Feather
 
Webhooks with Azure Functions - Live 360 Conference
Webhooks with Azure Functions - Live 360 ConferenceWebhooks with Azure Functions - Live 360 Conference
Webhooks with Azure Functions - Live 360 ConferenceSparkPost
 
Android Functional UI Testing at Amplify
Android Functional UI Testing at AmplifyAndroid Functional UI Testing at Amplify
Android Functional UI Testing at Amplifyjdlloyd1
 
Drupal Performance
Drupal Performance Drupal Performance
Drupal Performance Pantheon
 
Agile Testing Days 2018 USA - API Testing Fundamentals
Agile Testing Days 2018 USA - API Testing FundamentalsAgile Testing Days 2018 USA - API Testing Fundamentals
Agile Testing Days 2018 USA - API Testing FundamentalsJoEllen Carter
 
Automating OWASP ZAP - DevCSecCon talk
Automating OWASP ZAP - DevCSecCon talk Automating OWASP ZAP - DevCSecCon talk
Automating OWASP ZAP - DevCSecCon talk Simon Bennetts
 
QA Fest 2018. Сергей Король. REACTive automation: how to avoid shooting yours...
QA Fest 2018. Сергей Король. REACTive automation: how to avoid shooting yours...QA Fest 2018. Сергей Король. REACTive automation: how to avoid shooting yours...
QA Fest 2018. Сергей Король. REACTive automation: how to avoid shooting yours...QAFest
 
Selenoid & Allure - how to make them work together?
Selenoid & Allure -  how to make them work together?Selenoid & Allure -  how to make them work together?
Selenoid & Allure - how to make them work together?Michał Ślęzak
 
OWASP 2013 EU Tour Amsterdam ZAP Intro
OWASP 2013 EU Tour Amsterdam ZAP IntroOWASP 2013 EU Tour Amsterdam ZAP Intro
OWASP 2013 EU Tour Amsterdam ZAP IntroSimon Bennetts
 
AtlasCamp 2015: Plugins 2: All grown up
AtlasCamp 2015: Plugins 2: All grown upAtlasCamp 2015: Plugins 2: All grown up
AtlasCamp 2015: Plugins 2: All grown upAtlassian
 
RapidDev - Develop Titanium apps at the speed of the web!
RapidDev - Develop Titanium apps  at the speed of the web!RapidDev - Develop Titanium apps  at the speed of the web!
RapidDev - Develop Titanium apps at the speed of the web!Matt Apperson
 
Operationalizing Red Teaming for Fun and Profit
Operationalizing Red Teaming for Fun and ProfitOperationalizing Red Teaming for Fun and Profit
Operationalizing Red Teaming for Fun and ProfitSonatype
 
Practical continuous quality gates for development process
Practical continuous quality gates for development processPractical continuous quality gates for development process
Practical continuous quality gates for development processAndrii Soldatenko
 
Intro to DefectDojo at OWASP Switzerland
Intro to DefectDojo at OWASP SwitzerlandIntro to DefectDojo at OWASP Switzerland
Intro to DefectDojo at OWASP SwitzerlandMatt Tesauro
 
JavaOne 2015: Top Performance Patterns Deep Dive
JavaOne 2015: Top Performance Patterns Deep DiveJavaOne 2015: Top Performance Patterns Deep Dive
JavaOne 2015: Top Performance Patterns Deep DiveAndreas Grabner
 
BlackHat 2014 OWASP ZAP Turbo Talk
BlackHat 2014 OWASP ZAP Turbo TalkBlackHat 2014 OWASP ZAP Turbo Talk
BlackHat 2014 OWASP ZAP Turbo TalkSimon Bennetts
 

What's hot (20)

Philly CocoaHeads 20160414 - Building Your App SDK With Swift
Philly CocoaHeads 20160414 - Building Your App SDK With SwiftPhilly CocoaHeads 20160414 - Building Your App SDK With Swift
Philly CocoaHeads 20160414 - Building Your App SDK With Swift
 
Continous integration and delivery for single page applications
Continous integration and delivery for single page applicationsContinous integration and delivery for single page applications
Continous integration and delivery for single page applications
 
Cross platform native development with appcelerator titanium (2014 devnexus)
Cross platform native development with appcelerator titanium (2014 devnexus)Cross platform native development with appcelerator titanium (2014 devnexus)
Cross platform native development with appcelerator titanium (2014 devnexus)
 
Webhooks with Azure Functions - Live 360 Conference
Webhooks with Azure Functions - Live 360 ConferenceWebhooks with Azure Functions - Live 360 Conference
Webhooks with Azure Functions - Live 360 Conference
 
Android Functional UI Testing at Amplify
Android Functional UI Testing at AmplifyAndroid Functional UI Testing at Amplify
Android Functional UI Testing at Amplify
 
Drupal Performance
Drupal Performance Drupal Performance
Drupal Performance
 
Agile Testing Days 2018 USA - API Testing Fundamentals
Agile Testing Days 2018 USA - API Testing FundamentalsAgile Testing Days 2018 USA - API Testing Fundamentals
Agile Testing Days 2018 USA - API Testing Fundamentals
 
Automating OWASP ZAP - DevCSecCon talk
Automating OWASP ZAP - DevCSecCon talk Automating OWASP ZAP - DevCSecCon talk
Automating OWASP ZAP - DevCSecCon talk
 
PyCon Ukraine 2014
PyCon Ukraine 2014PyCon Ukraine 2014
PyCon Ukraine 2014
 
QA Fest 2018. Сергей Король. REACTive automation: how to avoid shooting yours...
QA Fest 2018. Сергей Король. REACTive automation: how to avoid shooting yours...QA Fest 2018. Сергей Король. REACTive automation: how to avoid shooting yours...
QA Fest 2018. Сергей Король. REACTive automation: how to avoid shooting yours...
 
Selenium for Jobseekers
Selenium for JobseekersSelenium for Jobseekers
Selenium for Jobseekers
 
Selenoid & Allure - how to make them work together?
Selenoid & Allure -  how to make them work together?Selenoid & Allure -  how to make them work together?
Selenoid & Allure - how to make them work together?
 
OWASP 2013 EU Tour Amsterdam ZAP Intro
OWASP 2013 EU Tour Amsterdam ZAP IntroOWASP 2013 EU Tour Amsterdam ZAP Intro
OWASP 2013 EU Tour Amsterdam ZAP Intro
 
AtlasCamp 2015: Plugins 2: All grown up
AtlasCamp 2015: Plugins 2: All grown upAtlasCamp 2015: Plugins 2: All grown up
AtlasCamp 2015: Plugins 2: All grown up
 
RapidDev - Develop Titanium apps at the speed of the web!
RapidDev - Develop Titanium apps  at the speed of the web!RapidDev - Develop Titanium apps  at the speed of the web!
RapidDev - Develop Titanium apps at the speed of the web!
 
Operationalizing Red Teaming for Fun and Profit
Operationalizing Red Teaming for Fun and ProfitOperationalizing Red Teaming for Fun and Profit
Operationalizing Red Teaming for Fun and Profit
 
Practical continuous quality gates for development process
Practical continuous quality gates for development processPractical continuous quality gates for development process
Practical continuous quality gates for development process
 
Intro to DefectDojo at OWASP Switzerland
Intro to DefectDojo at OWASP SwitzerlandIntro to DefectDojo at OWASP Switzerland
Intro to DefectDojo at OWASP Switzerland
 
JavaOne 2015: Top Performance Patterns Deep Dive
JavaOne 2015: Top Performance Patterns Deep DiveJavaOne 2015: Top Performance Patterns Deep Dive
JavaOne 2015: Top Performance Patterns Deep Dive
 
BlackHat 2014 OWASP ZAP Turbo Talk
BlackHat 2014 OWASP ZAP Turbo TalkBlackHat 2014 OWASP ZAP Turbo Talk
BlackHat 2014 OWASP ZAP Turbo Talk
 

Similar to Oscon presentation

Continuous Delivery: releasing Better and Faster at Dashlane
Continuous Delivery: releasing Better and Faster at DashlaneContinuous Delivery: releasing Better and Faster at Dashlane
Continuous Delivery: releasing Better and Faster at DashlaneDashlane
 
Building High Quality Android Applications
Building High Quality Android ApplicationsBuilding High Quality Android Applications
Building High Quality Android ApplicationsLeif Janzik
 
Application Lifecycle Management
Application Lifecycle ManagementApplication Lifecycle Management
Application Lifecycle ManagementAmazon Web Services
 
Code review and security audit in private cloud - Arief Karfianto
Code review and security audit in private cloud - Arief KarfiantoCode review and security audit in private cloud - Arief Karfianto
Code review and security audit in private cloud - Arief Karfiantoidsecconf
 
Effective Android Development. UA Mobile 2016.
Effective Android Development. UA Mobile 2016.Effective Android Development. UA Mobile 2016.
Effective Android Development. UA Mobile 2016.UA Mobile
 
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...Daniel Gallego Vico
 
Is code review the solution?
Is code review the solution?Is code review the solution?
Is code review the solution?Tiago Mendo
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsAmazon Web Services
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsAmazon Web Services
 
apidays New York 2023 - Putting yourself out there - how to secure your publi...
apidays New York 2023 - Putting yourself out there - how to secure your publi...apidays New York 2023 - Putting yourself out there - how to secure your publi...
apidays New York 2023 - Putting yourself out there - how to secure your publi...apidays
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium IntroNicholas Jansma
 
Automated Testing – Web, Mobile, Desktop - Challenges and Successes
Automated Testing – Web, Mobile, Desktop - Challenges and SuccessesAutomated Testing – Web, Mobile, Desktop - Challenges and Successes
Automated Testing – Web, Mobile, Desktop - Challenges and SuccessesTed Drake
 
Why Plone Will Die
Why Plone Will DieWhy Plone Will Die
Why Plone Will DieAndreas Jung
 
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptxThe Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptxlior mazor
 
PittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earth
PittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earthPittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earth
PittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earthGrace Jansen
 
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERContinuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERIndrajit Poddar
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using JenkinsRogue Wave Software
 
Hacklu2011 tricaud
Hacklu2011 tricaudHacklu2011 tricaud
Hacklu2011 tricaudstricaud
 
Laying the Foundation for Ionic Platform Insights on Spark
Laying the Foundation for Ionic Platform Insights on SparkLaying the Foundation for Ionic Platform Insights on Spark
Laying the Foundation for Ionic Platform Insights on SparkIonic Security
 
we45 DEFCON Workshop - Building AppSec Automation with Python
we45 DEFCON Workshop - Building AppSec Automation with Pythonwe45 DEFCON Workshop - Building AppSec Automation with Python
we45 DEFCON Workshop - Building AppSec Automation with PythonAbhay Bhargav
 

Similar to Oscon presentation (20)

Continuous Delivery: releasing Better and Faster at Dashlane
Continuous Delivery: releasing Better and Faster at DashlaneContinuous Delivery: releasing Better and Faster at Dashlane
Continuous Delivery: releasing Better and Faster at Dashlane
 
Building High Quality Android Applications
Building High Quality Android ApplicationsBuilding High Quality Android Applications
Building High Quality Android Applications
 
Application Lifecycle Management
Application Lifecycle ManagementApplication Lifecycle Management
Application Lifecycle Management
 
Code review and security audit in private cloud - Arief Karfianto
Code review and security audit in private cloud - Arief KarfiantoCode review and security audit in private cloud - Arief Karfianto
Code review and security audit in private cloud - Arief Karfianto
 
Effective Android Development. UA Mobile 2016.
Effective Android Development. UA Mobile 2016.Effective Android Development. UA Mobile 2016.
Effective Android Development. UA Mobile 2016.
 
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...
Droidcon Spain 2105 - One app to rule them all: Methodologies, Tools & Tricks...
 
Is code review the solution?
Is code review the solution?Is code review the solution?
Is code review the solution?
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer ToolsDevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
DevOps on AWS: Deep Dive on Continuous Delivery and the AWS Developer Tools
 
apidays New York 2023 - Putting yourself out there - how to secure your publi...
apidays New York 2023 - Putting yourself out there - how to secure your publi...apidays New York 2023 - Putting yourself out there - how to secure your publi...
apidays New York 2023 - Putting yourself out there - how to secure your publi...
 
Appcelerator Titanium Intro
Appcelerator Titanium IntroAppcelerator Titanium Intro
Appcelerator Titanium Intro
 
Automated Testing – Web, Mobile, Desktop - Challenges and Successes
Automated Testing – Web, Mobile, Desktop - Challenges and SuccessesAutomated Testing – Web, Mobile, Desktop - Challenges and Successes
Automated Testing – Web, Mobile, Desktop - Challenges and Successes
 
Why Plone Will Die
Why Plone Will DieWhy Plone Will Die
Why Plone Will Die
 
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptxThe Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
The Hacking Games - A Road to Post Exploitation Meetup - 20240222.pptx
 
PittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earth
PittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earthPittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earth
PittsburgJUG_Cloud-Native Dev Tools: Bringing the cloud back to earth
 
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWERContinuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
Continuous Integration with Cloud Foundry Concourse and Docker on OpenPOWER
 
Test parallelization using Jenkins
Test parallelization using JenkinsTest parallelization using Jenkins
Test parallelization using Jenkins
 
Hacklu2011 tricaud
Hacklu2011 tricaudHacklu2011 tricaud
Hacklu2011 tricaud
 
Laying the Foundation for Ionic Platform Insights on Spark
Laying the Foundation for Ionic Platform Insights on SparkLaying the Foundation for Ionic Platform Insights on Spark
Laying the Foundation for Ionic Platform Insights on Spark
 
we45 DEFCON Workshop - Building AppSec Automation with Python
we45 DEFCON Workshop - Building AppSec Automation with Pythonwe45 DEFCON Workshop - Building AppSec Automation with Python
we45 DEFCON Workshop - Building AppSec Automation with Python
 

Recently uploaded

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 

Recently uploaded (20)

"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 

Oscon presentation

  • 1. Open Source at Scale 1 Garrett Moon OSCON, July 23rd, 2015 Building Pinterest’s iOS App
  • 2. Open Source at Scale 2 Garrett Moon OSCON, July 23rd, 2015 Building Pinterest’s iOS App
  • 5. Why We Use Open Source 5 Scale Pinterest has significantly fewer iOS engineers than Facebook 1 Speed Move quickly from prototype to production 2 Reliability Open source projects are often old and well tested 3
  • 6.
  • 7. Open Source At Pinterest 7 Over 15 open source projects Pinball: A scalable workflow manager Secor: A service implementing Kafka log persistence PINCache: Fast non-deadlocking parallel object cache for iOS and OS X
  • 8. Open Source on iOS • AFNetworking • PINCache • PINRemoteImage • FLAnimatedImage • Kingpin • Masonry • AsyncDisplayKit • Pop • Realm Just some of the great projects we use 8 2:50 PM 100%
  • 9. 9 target 'PINRemoteImage', :exclusive => true do pod "PINRemoteImage", :path => "../" pod "PINCache", '2.0' pod "libwebp" end target 'PINRemoteImage Tests', :exclusive => true do pod "PINRemoteImage", :path => "../" end Package Management with CocoaPods Specify version numbers. Run `pod outdated` regularly.
  • 11. No second chances Shipping iOS apps is like shipping packaged software. 11
  • 12. Ship Frequently & Regularly Monday Tuesday Wednesday Thursday Friday START
  • 13. Ship Frequently & Regularly Monday Tuesday Wednesday Thursday Friday START CODE CODE CODE CODE CODE CODE CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE > P1 BUGS > P1 BUGS SUBMIT
  • 14. Ship Frequently & Regularly Monday Tuesday Wednesday Thursday Friday START CODE CODE CODE CODE CODE CODE CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE > P1 BUGS > P1 BUGS SUBMIT WAIT WAIT WAIT WAIT WAIT SHIP
  • 15. Ship Frequently & Regularly Monday Tuesday Wednesday Thursday Friday START CODE CODE CODE CODE CODE CODE CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE > P1 BUGS > P1 BUGS SUBMIT START CODE CODE CODE CODE SHIP CODE CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE
  • 16. Ship Frequently & Regularly Monday Tuesday Wednesday Thursday Friday > P1 BUGS > P1 BUGS SUBMIT START CODE CODE CODE CODE CODE CODE CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE > P1 BUGS > P1 BUGS SUBMIT START CODE CODE CODE CODE SHIP CODE CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE
  • 17. Ship Frequently & Regularly Monday Tuesday Wednesday Thursday Friday > P1 BUGS > P1 BUGS SUBMIT START CODE CODE CODE CODE CODE CODE CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE > P1 BUGS > P1 BUGS SUBMIT START CODE CODE CODE CODE SHIP CODE CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE P1 > BUGS P1 > BUGS SUBMIT START CODE CODE CODE CODE SHIP CODE CODE FEATURE FREEZE > P2 BUGS > P2 BUGS CODE FREEZE > P1 BUGS > P1 BUGS SUBMIT
  • 19. Crashes Crash Reporting • Helps diagnose and fix issues from previous releases • Users affected • Sessions affected • Devices affected Tools • NSZombies • Leaks • Address Sanitizer 19
  • 20. 20 Testing Continuous Testing • Unit tests around processing code and models • Continuous Integration testing around core library interactions • UI Automation tests around core flows User Testing • Nightly internal builds for all employees • Small contracted team does user testing nightly • Core team tests rigorously before release
  • 21. Deadlocks • Possibly stuck in a loop • Probably blocked waiting on another thread • Sometimes caused by a corrupted UI • Thread explosion when using queues as locks • Dogfood with a deadlock detector 21
  • 22. Thread explosion The dark side of using a serial queue as a lock 22 Main Thread Serial Queue Create a threadx100 waiting… waiting… Concurrent Queue
  • 23. Deadlocks • Possibly stuck in a loop • Probably blocked waiting on another thread • Sometimes caused by a corrupted UI • Thread explosion when using queues as locks • Dogfood with a deadlock detector 23
  • 24. Monitoring • Log everything • API requests • Client side usage • Performance • Monitor to spot problems • App Store ratings • Crash rates • Usage metrics 24
  • 25. Experimenting • Everything is an experiment • Short and long term analyses • You are the only one desperate for your new feature 25
  • 26. Automation • OTA builds • Unit, integration and UI tests • Performance tests • Linters 26
  • 28. Pinterest mobile users download hundreds of images per day.
  • 29. Introducing PINRemoteImage 29 A thread safe, performant, feature rich image fetcher
  • 30. PINRemoteImage • Image downloading (obviously) • Image caching (on disk and in memory) • De-duping image downloads • Setting download and processing priority • Prefetching images • Image decompression off the main thread A thread safe, performant, feature rich image fetcher 30
  • 31. Multi-format Support • JPEG • Progressive decoding • PNG • WebP • FLAnimatedImage Supports downloading a variety of formats: 31
  • 32. 32 Animated GIFs Supported by FLAnimatedImage FLAnimatedImageView *animatedImageView = [[FLAnimatedImageView alloc] init]; [animatedImageView setImageFromURL: [NSURL URLWithString:@"http://pinterest.com/flyingKitten.gif"]];
  • 33. Progressive JPEG With an attractive blur 33 A mother with her son Dejan Muazer Cats 1 A mother with her son Dejan Muazer Cats 2 A mother with her son Dejan Muazer Cats 3 A mother with her son Dejan Muazer Cats 4
  • 34. 34 Progressive JPEG With an attractive blur UIImageView *imageView = [[UIImageView alloc] init]; [imageView setUpdateWithProgress:YES]; [imageView setImageFromURL: [NSURL URLWithString:@"http://pinterest.com/progressiveKitten.jpg"]];
  • 35. Adaptable Quality Downloading Download varying quality images based on network conditions Confidential 35Source: Placeholder Numbers 2:50 PM 100% 50 Kbps 2:50 PM 100% 100 Kbps 2:50 PM 100% 200 Kbps
  • 36. Adaptive Quality Downloading 36 Download varying quality images based on network conditions UIImageView *imageView = [[UIImageView alloc] init]; [imageView setImageFromURLs: @[[NSURL URLWithString:@"http://pinterest.com/lowQualityKitten.webp"], [NSURL URLWithString:@"http://pinterest.com/mediumQualityKitten.webp"], [NSURL URLWithString:@"http://pinterest.com/highQualityKitten.webp"]]]; [[PINRemoteImageManager sharedImageManager] setShouldUpgradeLowQualityImages:YES completion:nil];
  • 37. Image Processing With an easy to write processing block 37
  • 38. Image Processing With an easy to write processing block 38 [self.imageView setImageFromURL: [NSURL URLWithString:@"http://pinterest.com/kitten-image.jpg"] processorKey:@"rounded" processor:^UIImage *(PINRemoteImageManagerResult *result, NSUInteger *cost) { UIGraphicsBeginImageContext(result.image.size); //add rounded clip [result.image drawInRect:drawRect]; UIImage *processedImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return processedImage; }];
  • 39. How it works 39 Whiskers Download Kitten 1 Round Kitten 1 Round Kitten 1 Download Round Kitten 1 Round Kitten 1 Process Round Kitten 2 Download Round Kitten 2 Process MEOW. MEOW. MEOW.