Software developers rely on a fast and correct build system to compile their source code changes and produce modified deliverables for testing and deployment. The scale and complexity of the PostgreSQL build process makes build performance an important topic to discuss and address.
In this talk, we will introduce a new build performance analysis technique that identifies "build hotspots", i.e., files that are slow to rebuild (by analyzing a build dependency graph), yet change often (by analyzing version control history). We will discuss the identified hotspots in the 9.2.4 release of PostgreSQL.
Dev Dives: Streamline document processing with UiPath Studio Web
Identifying Build Hotspots in PostgreSQL Using Dependency Graphs and File Churn
1. Identifying Hotspots in the
PostgreSQL Build Processes
Shane
McIntosh
Bram
Adams
Meiyappan
Nagappan
Ahmed E.
Hassan
@shane_mcintosh
shanemcintosh@acm.org
3. What is a build system?
Source
code
Deliverable
!2
4. Build systems describe how sources are
translated into deliverables
.c
.o
.cc
.o
.exe
.tex
.dvi
.pdf
.a
.deb
!3
5. All builds are equal…
(1)
Think
(2)
Edit
The
developer’s
work cycle
(4)
Test
(3)
Build
!4
6. …But some builds are more
equal than others
“
http://xkcd.com/303/
Why is the gtk build so abysmally slow?
This hinders our ability to run gtk bots
and keep the gtk build green. :(
”
!5
21. MAKAO tool extracts build
dependency graphs
(1)
Dependency
Graph
Construction
(2)
Dependency
Graph
Analysis
Design recovery and maintenance of build systems
B. Adams, Herman Tromp, Kris De Schutter, Wolfgang De Meuter
[ICSM 2007]
!10
22. The cost of traversing an edge is
derived by timing its build command
(1)
Dependency
Graph
Construction
(2)
Dependency
Graph
Analysis
Median of 10
repetitions
!11
32. Let’s see what
developers think!
> Please answer the following questions for each
source file listed above:!
> (1) Is this source code file a performance
bottleneck? Y/N!
!
For all of them no...
!18
33. Let’s see what
developers think!
> Please answer the following questions for each
source file listed above:!
> (1) Is this source code file a performance
bottleneck? Y/N!
!
For all of them no...!
!
> (2) Why do you believe this file is or is not a
performance bottleneck?!
!
...because none of these headers change often.
!19
34. …But where should we focus
refactoring effort?
Files that rebuild
the slowest?
!20
35. …But where should we focus
refactoring effort?
Files that rebuild
the slowest?
…but they may
only rarely change!
!20
36. …But where should we focus
refactoring effort?
Files that rebuild
the slowest?
Files that change
the most often?
…but they may
only rarely change!
!20
37. Mining frequently changing files
from version control
Terminal
$ git clone …
…
$ git checkout <some_tag>
…
$ git log --oneline <some_file>
!21
38. Mining frequently changing files
from version control
But many of these files
$ git clone …
…
already build quickly!
Terminal
$ git checkout <some_tag>
…
$ git log --oneline <some_file>
!21
39. …But where should we focus
refactoring effort?
Files that rebuild
the slowest?
Files that change
the most often?
…but they may
only rarely change!
!22
40. …But where should we focus
refactoring effort?
Files that rebuild
the slowest?
Files that change
the most often?
…but they may
only rarely change!
…but they may
already be optimal!
!22
41. …But where should we focus
refactoring effort?
Files that rebuild
the slowest?
Files that change
the most:often?
ots
…but they may
only rarely change!
…but they may
already be optimal!
otsp
h
ft e n
uild
ge o
on b
han
cus
nd c
Fo
ly a
slow
build
at re
es th
il
F
!22
64. 2nd International Workshop on Release Engineering
RELENG 2014
keynotes
?
?
http://releng.polymtl.ca
talks on
research
and
practice
poster
session
and panel
Deadline: February 28, 2014
Event: April 11, 2014
65. 2nd International Workshop on Release Engineering
RELENG 2014
keynotes
http://releng.polymtl.ca
?
?
hosted in
Mountainview (CA, US)
by
talks on
research
and
practice
poster
session
and panel
Deadline: February 28, 2014
Event: April 11, 2014
66. 2nd International Workshop on Release Engineering
RELENG 2014
keynotes
McNutt
Dinah le)
(Goog
hosted in
Mountainview (CA, US)
by
?
http://releng.polymtl.ca
talks on
research
and
practice
poster
session
and panel
Deadline: February 28, 2014
Event: April 11, 2014