SlideShare ist ein Scribd-Unternehmen logo
1 von 63
Downloaden Sie, um offline zu lesen
Why is my build
times so long?
1 / 63
My name is Kevin
I like community
organizing
and biking 🚴
2 / 63
Who here has tried
waiting for your
computer/CI to finish
the build?
3 / 63
I don't like waiting
4 / 63
What is long build
times?
5 / 63
waiting == less
productivitiy
less productivity == less
money
less money == you die
6 / 63
builds are inevitable
7 / 63
8 / 63
Build time scales
linearly
Time
Buildtime
9 / 63
We are building
bigger and better
apps
10 / 63
Companies have
bigger engineering
teams than ever
11 / 63
✅Consistent builds
12 / 63
✅Docker 🐳
13 / 63
So how we used to
solve it:
14 / 63
Wait on machines getting
faster aka.
Moore's law
15 / 63
2 techniques we can
use:
16 / 63
1. Caching
2. Do less
(3. Optimize)
17 / 63
Everyone uses
webpack
18 / 63
Wait!? Let's look if they
already solved it!
19 / 63
20 / 63
1. Caching
There are only two hard things
in Computer Science: cache
invalidation and naming
things. -- Phil Karlton
21 / 63
Knowing what has
been cached and has
not
22 / 63
Saving and retriving
cache
23 / 63
2. Do less
Removing code so that it
doesn't get run
24 / 63
Using multiple
repositories
25 / 63
The problem is:
collaborations
problems
26 / 63
There is a difference:
your company code !=
open source code
27 / 63
Example:
28 / 63
Project A + UI library
2 min | 2 min
29 / 63
Project A
UI Library
30 / 63
Project A
Project B
UI Library
31 / 63
Project A
Project B
UI Library v.1
32 / 63
Project A v.1
Project B v.1
UI Library v.1
33 / 63
Project A v.1
Project B v.1.1
UI Library v.1.1
34 / 63
Project A v.1.2
Project B v.1.1
UI Library v.1.2
35 / 63
Project A v.1.2
Project B v.2
UI Library v.2
36 / 63
NIGHTMARE!
37 / 63
That is why public
packages
left-pad?
38 / 63
So how do we solve
it?
39 / 63
We need a tool that:
- define
dependencies
- watch files changes
- language agnostic
40 / 63
projectA/
index.js
projectB/
index.js
projectC/
index.js
library/
lib.js
41 / 63
projectA/
index.js*
projectB/
index.js
projectC/
index.js
library/
lib.js
42 / 63
projectA/
index.js*
projectB/
index.js
projectC/
index.js
library/
lib.js
Builds started:
- projectA ...
43 / 63
What if a library
change?
44 / 63
projectA/
index.js
projectB/
index.js
projectC/
index.js
library/
lib.js*
Builds started:
- library ...
- projectA ...
- projectB ...
- projectC ...
45 / 63
Watch files changes
It tracks content of file
46 / 63
bazel.build can help
with that
47 / 63
copenhagenjs.dk uses
it
48 / 63
at first I didn't
understand
49 / 63
Bazel is also weird!
JavaScript is not 1st
class citizen!?
50 / 63
Python like Syntax
genrule(
name = "build",
srcs = ["server.js"],
cmd = "cat $< > $@",
outs = ["server.min.js"]
)
51 / 63
Great rules:
- Not allowed to
depend on ".."
- Copies files to
temporary folder
52 / 63
src/
index.js
⇣
temp/
# puts files here!
⇣
output/
# detects if you write to here!
53 / 63
It doesn't allow
circular dependencies
A -> B -> A
54 / 63
Automatically
Output of one task ->
input next task
55 / 63
genrule(
...
outs = ["build.tar.gz"],
)
genrule(
srcs = ["build.tar.gz", "firebase.json"],
...
)
56 / 63
Future for me:
- Store the state on
S3 or GCS
57 / 63
No more ✅:
Change 1 line in
markdown
All JavaScript tests
run!
58 / 63
Don't accept slow
builds!
Don't accept terrible
collaboration!
59 / 63
Do break up your
builds to many small
builds
Do encourage
collaboration!
60 / 63
I really encourage you
to use Bazel
Even seniors are
juniors with bazel
61 / 63
Thank you!
Questions?
Check out
kevinsimper.dk
62 / 63
63 / 63

Weitere ähnliche Inhalte

Ähnlich wie Why is my build times so long?

Contents_KiCad 6 Like A Pro – Projects.pdf
Contents_KiCad 6 Like A Pro – Projects.pdfContents_KiCad 6 Like A Pro – Projects.pdf
Contents_KiCad 6 Like A Pro – Projects.pdf
Leonardo Hernandez
 
Dissertation_of_Pieter_van_Zyl_2_March_2010
Dissertation_of_Pieter_van_Zyl_2_March_2010Dissertation_of_Pieter_van_Zyl_2_March_2010
Dissertation_of_Pieter_van_Zyl_2_March_2010
Pieter Van Zyl
 
2010 13.guide de_la_programmation_avec_qgis_1.5_extensions_et_applications_pr...
2010 13.guide de_la_programmation_avec_qgis_1.5_extensions_et_applications_pr...2010 13.guide de_la_programmation_avec_qgis_1.5_extensions_et_applications_pr...
2010 13.guide de_la_programmation_avec_qgis_1.5_extensions_et_applications_pr...
Eduardo Nuno
 

Ähnlich wie Why is my build times so long? (20)

Testing Persistent Storage Performance in Kubernetes with Sherlock
Testing Persistent Storage Performance in Kubernetes with SherlockTesting Persistent Storage Performance in Kubernetes with Sherlock
Testing Persistent Storage Performance in Kubernetes with Sherlock
 
Thesis
ThesisThesis
Thesis
 
Srs
SrsSrs
Srs
 
Contents_KiCad 6 Like A Pro – Projects.pdf
Contents_KiCad 6 Like A Pro – Projects.pdfContents_KiCad 6 Like A Pro – Projects.pdf
Contents_KiCad 6 Like A Pro – Projects.pdf
 
Successful Software Development with Apache Cassandra
Successful Software Development with Apache CassandraSuccessful Software Development with Apache Cassandra
Successful Software Development with Apache Cassandra
 
Cassandra Summit 2014: Successful Software Development with Apache Cassandra
Cassandra Summit 2014: Successful Software Development with Apache CassandraCassandra Summit 2014: Successful Software Development with Apache Cassandra
Cassandra Summit 2014: Successful Software Development with Apache Cassandra
 
Project final report
Project final reportProject final report
Project final report
 
Systems se
Systems seSystems se
Systems se
 
thesis
thesisthesis
thesis
 
thesis
thesisthesis
thesis
 
Workshop About Software Engineering Skills 2019
Workshop About Software Engineering Skills 2019Workshop About Software Engineering Skills 2019
Workshop About Software Engineering Skills 2019
 
Lightweight APIs in mRuby (Михаил Бортник)
Lightweight APIs in mRuby (Михаил Бортник)Lightweight APIs in mRuby (Михаил Бортник)
Lightweight APIs in mRuby (Михаил Бортник)
 
thesis
thesisthesis
thesis
 
1st slide VLSI.pdf
1st slide VLSI.pdf1st slide VLSI.pdf
1st slide VLSI.pdf
 
Dissertation_of_Pieter_van_Zyl_2_March_2010
Dissertation_of_Pieter_van_Zyl_2_March_2010Dissertation_of_Pieter_van_Zyl_2_March_2010
Dissertation_of_Pieter_van_Zyl_2_March_2010
 
report
reportreport
report
 
diss
dissdiss
diss
 
2010 13.guide de_la_programmation_avec_qgis_1.5_extensions_et_applications_pr...
2010 13.guide de_la_programmation_avec_qgis_1.5_extensions_et_applications_pr...2010 13.guide de_la_programmation_avec_qgis_1.5_extensions_et_applications_pr...
2010 13.guide de_la_programmation_avec_qgis_1.5_extensions_et_applications_pr...
 
Kernel Recipes 2016 - The kernel report
Kernel Recipes 2016 - The kernel reportKernel Recipes 2016 - The kernel report
Kernel Recipes 2016 - The kernel report
 
Lightweight APIs in mRuby
Lightweight APIs in mRubyLightweight APIs in mRuby
Lightweight APIs in mRuby
 

Mehr von Kevin Simper

Mehr von Kevin Simper (10)

Building a game with WebVR
Building a game with WebVRBuilding a game with WebVR
Building a game with WebVR
 
How to create a CV
How to create a CVHow to create a CV
How to create a CV
 
Building P2P in the browser for zero cost
Building P2P in the browser for zero costBuilding P2P in the browser for zero cost
Building P2P in the browser for zero cost
 
How Kubernetes allows your Startup to scale
How Kubernetes allows your Startup to scaleHow Kubernetes allows your Startup to scale
How Kubernetes allows your Startup to scale
 
Contributing Open-Source workshop
Contributing Open-Source workshopContributing Open-Source workshop
Contributing Open-Source workshop
 
WebVR is now accessible
WebVR is now accessibleWebVR is now accessible
WebVR is now accessible
 
Kubernetes at Google Cloud Community Copenhagen
Kubernetes at Google Cloud Community CopenhagenKubernetes at Google Cloud Community Copenhagen
Kubernetes at Google Cloud Community Copenhagen
 
Making Docker and Kubernetes a success at your Company
Making Docker and Kubernetes a success at your CompanyMaking Docker and Kubernetes a success at your Company
Making Docker and Kubernetes a success at your Company
 
Docker Best Practices in development and Production
Docker Best Practices in development and Production Docker Best Practices in development and Production
Docker Best Practices in development and Production
 
Hack4dk presentation
Hack4dk presentationHack4dk presentation
Hack4dk presentation
 

Kürzlich hochgeladen

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Kürzlich hochgeladen (20)

Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Why is my build times so long?