Skip to content

Commit 45abfab

Browse files
committed
Add aosp 16 LoC post
1 parent 9f28885 commit 45abfab

File tree

5 files changed

+157
-1
lines changed

5 files changed

+157
-1
lines changed

content/blog/size-aosp.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ date = 2024-01-02
55
template = "blog-entry.html"
66
+++
77

8+
_Update:_ I got some newer data from [Android 16](/blog/size-aosp16).
9+
810
If you want a number <b>2.5 million lines</b> is a reasonable estimate. If you want to know more about it, continue reading.
911

1012
The values from this blog post will refer the main branch of the <a href="https://source.android.com/">Android open source project (AOSP)</a> as of October 20, 2023, but the methology can be relevant for future versions.

content/blog/size-aosp14.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ date = 2024-08-23
55
template = "blog-entry.html"
66
+++
77

8-
You probably came here because you searched for how much code on your device runs. The rough answer is 66 million for explanations why putting a number on this is misleading read the next section. If you want to explore explore the data yourself there are two more detailed sections below.
8+
_Update:_ I got some newer data from [Android 16](/blog/size-aosp16).
9+
10+
You probably came here because you searched for how much code on your device runs. The rough answer is 66 million, for explanations why putting a number on this is misleading read the next section. If you want to explore explore the data yourself there are two more detailed sections below.
911

1012
## To be Android or not to be Android
1113

content/blog/size-aosp16.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
+++
2+
title = "How many lines of code are in Android 16?"
3+
description = "Android 16 brings 250 million lines of code and comments to the table. Let's look at percentages!"
4+
date = 2025-06-12
5+
template = "blog-entry.html"
6+
+++
7+
8+
[Android 16](https://www.android.com/intl/en_us/new-features-on-android/?category=android-16) just released, and with it the code size grew again (+50 mil. LoC since Android 14). But you probably came here because you searched for how much code runs on your device. The rough answer is **92 million** for explanations why putting a number on this is misleading read [my last post on that matter](/blog/size-aosp14). If you want to explore explore the data yourself there are two more details below. As always the raw data and source code is [here](https://github.com/derdilla/aosp-analyzer).
9+
10+
## Quick facts
11+
12+
- There are over <b>250 million</b> source code lines contributing to android.
13+
- Roughly <b>92 million</b> lines of code run on the average device.
14+
- <b>83 million</b> lines of comments and documentation tell the developers what the code does.- <b>8.8%</b> lines are empty.
15+
16+
## Doughnut chart
17+
18+
This time I included this nice interactive doughnut chart of the programming languages used (unfortunately requires JavaScript).
19+
20+
{{ sizeofaosp16chart() }}
21+
22+
{{ sizeaosp16table() }}

templates/shortcodes/sizeaosp16table.html

Lines changed: 54 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<script src="https://cdn.jsdelivr.net/npm/vega@5"></script>
2+
<script src="https://cdn.jsdelivr.net/npm/vega-lite@5"></script>
3+
<script src="https://cdn.jsdelivr.net/npm/vega-embed@6"></script>
4+
<style>
5+
#lang-percent > svg {
6+
border-radius: 5px;
7+
width: min(90vw, 20em);
8+
height: min(90vw, 20em);
9+
padding: 0.5em;
10+
}
11+
</style>
12+
<div id="lang-percent" style="padding: 2em; margin: -2em;"></div>
13+
<script type="text/javascript">
14+
function showLangPercent() {
15+
const spec = {
16+
"$schema": "https://vega.github.io/schema/vega-lite/v5.json",
17+
"description": "A donut chart showing the lines of code in different programming languages as percentages.",
18+
"data": {
19+
"values": [{"category":"Rust","value":0.040753342,"loc":5931980},{"category":"Python","value":0.048271094,"loc":7026250},{"category":"Java","value":0.261234,"loc":38024728},{"category":"C","value":0.2689419,"loc":39146679},{"category":"C++","value":0.27130103,"loc":39490071},{"category":"Other","value":0.10949865,"loc":15938421}]
20+
},
21+
"layer": [
22+
{
23+
"params": [
24+
{
25+
"name": "highlight",
26+
"select": { "type": "point", "on": "pointerover" }
27+
},
28+
],
29+
"mark": {
30+
"type": "arc",
31+
"innerRadius": 50,
32+
"outerRadius": 100,
33+
"cornerRadius": 6,
34+
"padAngle": 0.04
35+
},
36+
"encoding": {
37+
"color": { "field": "category", "type": "nominal", "legend": null },
38+
"opacity": {
39+
"condition": [
40+
{
41+
"param": "highlight",
42+
"value": 1
43+
}
44+
],
45+
"value": 0.70
46+
},
47+
"tooltip": [
48+
{ "field": "value", "type": "quantitative", "title": "%" }
49+
]
50+
},
51+
},
52+
{
53+
"mark": { "type": "text", "radius": 75 },
54+
"encoding": {
55+
"text": { "field": "category", "type": "nominal" }
56+
}
57+
},
58+
{
59+
"mark": {
60+
"type": "text",
61+
"text": "Lanugages"
62+
},
63+
64+
}
65+
],
66+
"encoding": {
67+
"theta": { "field": "value", "type": "quantitative", "stack": true }
68+
}
69+
};
70+
71+
vegaEmbed('#lang-percent', spec, { renderer: "svg", actions: false })
72+
.catch(console.error);
73+
}
74+
75+
showLangPercent();
76+
</script>

0 commit comments

Comments
 (0)