The way pull requests are made, closed and merged has been intriguing me for a while.
Pull requests have slowly become the standard flow of operations for many teams shipping software products.Today Iโve asked myself: what is the average number of days to merge a pull request per programming language and how different is this average per language?
https://dl.dropboxusercontent.com/u/3509093/Charts/chart.html
This chart represents average number of days pull requests life span (time since it is created until itโs merged) on March on Github grouped by programming languageThis first thing to notice is that there is not that big of a difference between different programming languages. I was honestly expecting a bigger gap between these.I believe this is due to the process of pull request code review being a standard short period.
In fact, the average time to merge (the time since the pull request was created until it was merged) of the analyzed pull requests is 2.5 days. This means that on average a pull request is taking 2 days and a half to close.It appears that HTML (with an average of 1.31 days to merge) and CSS (with 1.48) have a lower average than the rest of languages.
This appears to make sense since all fixes done should include less logic change than remaining languages.It is also interesting to see languages of approximate syntax being close together.
Take a look on how Java (1.61d) and C# (1.48d) are very close together. However, while Java includes a total of 43,863 pull requests under analysis, C# has 12,262 which speaks about the open source component of both languages.
C (2.31d) and C++ (2.46d) are also placing next to each other.It is interesting to see that Python takes almost 1 day longer to merge a pull request than Javascript.We can also take look at this in other ways (and there are certainly more programming languages to talk about). But first, letโs talk about the process to make this chart.
Process
- We extracted all pull requests from open sourced Github projects that ended in March from GithubArchive.org.
- We calculated for every pull request the average number of days since it was created to the moment it was merged (not closed).
- We filtered all the pull requests that started before 6 months ago.
- We grouped theses pull requests by programming language of their project and filtered all programming languages that had less than 3000 pull requests in their groups.
Knowing this, we can try to include of filter more information from the chart.
Alternative views
In the previous chart We have a few languages with less number of pull requests accounted for the analysis, if we remove these (Scala, Go, Objective-C, CoffeeScript) this is what our chart looks like:
https://dl.dropboxusercontent.com/u/3509093/Charts/chartPopular.html
What if, however, we reduce the restriction of at least 3000 pull requests?
https://dl.dropboxusercontent.com/u/3509093/Charts/chartAll.html
The interesting aspect is Kotlin which is representing a time to merge at least 3 times bigger than the rest of programming languages.
Looking now at a set of 65 programming languages, one canโt help but awe how in sync people are shipping code. An average of 2.5 days with such a small apparent deviation is really fascinating.
Conclusion
Weโve seen the merging times of 400k pull requests and their programming languages.
Weโve seen how programming languages have very similar pull request lifespan with the exception of Kotlin.
Weโve seen the average time to merge of pull requests made in Java, Javascript, PHP, Python, Ruby.. Weโve actually seen this for 65 different languages.
An interesting analysis to follow up would be to find if these differences are the same month after month for closing pull requests.
What is your average time to merge?
Edit: We just published an ebook: โThe Ultimate Guide to Code Reviewโ based on a survey of 680+ developers. Enjoy!
About Codacy
Codacy is used by thousands of developers to analyze billions of lines of code every day!
Getting started is easy โ and free! Just use your GitHub, Bitbucket or Google account to sign up.