XML to JSON 
Convert 1,000,000 person records from XML to JSON as fast as possible.
Input
XML document on STDIN:
<?xml version="1.0" encoding="UTF-8"?>
<persons>
<person id="1512376">
<age>30</age>
<height>169.1</height>
<married>true</married>
<phone code="+6"><number>1283603279</number></phone>
<phone code="+6"><number>1659964668</number></phone>
</person>
...
</persons>
Output
One JSON object per person to STDOUT, preserving order:
{
"id": 1512376,
"age": 30,
"height": 169.1,
"married": true,
"phones": [
{
"code": "+6",
"number": 1283603279
},
{
"code": "+6",
"number": 1659964668
}
]
}
Constraints
- Preserve the order of persons
- Omit the
phonesfield if the phone array is empty - Maximum number of phones per person is 3
Source Code
Source code access is restricted. Log in to request access.
Challenge History
| Date | Challenger | Cost | Type | Status |
|---|---|---|---|---|
| Jul 6, 2026 11:33 | Victor Mercklé | 10.00 | Custom | Solution Broken |
Run Statistics
| # | Date | Score | Wall Time | CPU User | CPU System | Memory | Error | |
|---|---|---|---|---|---|---|---|---|
| 1 | Jul 6, 2026 11:35 | 0 | 10,868,784 | 0 | 1,395,000 | 2,117,632 | diff: map[string]any{ - "age": s"51", - "height": s"164.3", + "height": s"51", "id": s"517196", - "married": bool(false), + "married": s"64.3", - "phones": []any{ - map[string]any{"code": string("+8"), "number": s"171... | |
| 2 | Jul 6, 2026 11:35 | 0 | 10,503,153 | 0 | 1,415,000 | 2,117,632 | diff: map[string]any{ - "age": s"51", - "height": s"164.3", + "height": s"51", "id": s"517196", - "married": bool(false), + "married": s"64.3", - "phones": []any{ - map[string]any{"code": string("+8"), "number": s"171... | |
| 3 | Jul 6, 2026 11:35 | 0 | 10,606,869 | 0 | 1,387,000 | 2,117,632 | diff: map[string]any{ - "age": s"51", - "height": s"164.3", + "height": s"51", "id": s"517196", - "married": bool(false), + "married": s"64.3", - "phones": []any{ - map[string]any{"code": string("+8"), "number": s"171... | |
| 4 | Jan 18, 2026 06:18 | 5,719 | 75,188,478 | 31,024,000 | 21,016,000 | 94,670,848 | ||
| 5 | Jan 18, 2026 06:11 | 5,724 | 78,521,244 | 29,050,000 | 23,040,000 | 94,552,064 | ||
| 6 | Jan 18, 2026 06:13 | 5,725 | 77,818,397 | 32,061,000 | 20,038,000 | 94,670,848 | ||
| 7 | Jan 18, 2026 06:18 | 5,733 | 76,115,793 | 31,102,000 | 21,069,000 | 94,666,752 | ||
| 8 | Jan 18, 2026 06:13 | 5,740 | 77,756,866 | 31,139,000 | 21,094,000 | 94,662,656 | ||
| 9 | Jan 18, 2026 06:18 | 5,744 | 75,326,400 | 32,165,000 | 20,103,000 | 94,552,064 | ||
| 10 | Jan 18, 2026 06:18 | 5,745 | 74,986,532 | 32,172,000 | 20,107,000 | 94,560,256 | ||
| 11 | Jan 18, 2026 06:11 | 5,749 | 79,698,495 | 31,186,000 | 21,126,000 | 94,666,752 | ||
| 12 | Jan 18, 2026 06:13 | 5,752 | 78,616,209 | 33,218,000 | 19,126,000 | 94,662,656 | ||
| 13 | Jan 18, 2026 06:11 | 5,752 | 84,693,265 | 30,197,000 | 22,144,000 | 94,744,576 | ||
| 14 | Jan 18, 2026 06:13 | 5,754 | 83,092,371 | 29,200,000 | 23,158,000 | 94,674,944 | ||
| 15 | Jan 18, 2026 06:18 | 5,755 | 76,871,705 | 33,232,000 | 19,134,000 | 94,662,656 | ||
| 16 | Jan 18, 2026 06:11 | 5,755 | 77,778,606 | 29,206,000 | 23,163,000 | 94,679,040 | ||
| 17 | Jan 18, 2026 06:13 | 5,757 | 82,576,916 | 30,222,000 | 22,163,000 | 94,666,752 | ||
| 18 | Jan 18, 2026 06:18 | 5,758 | 74,945,455 | 31,238,000 | 21,161,000 | 94,552,064 | ||
| 19 | Jan 18, 2026 06:13 | 5,761 | 84,786,811 | 29,676,000 | 22,752,000 | 94,666,752 | ||
| 20 | Jan 18, 2026 06:11 | 5,763 | 78,119,086 | 30,256,000 | 22,187,000 | 94,552,064 | ||
| 21 | Jan 18, 2026 06:11 | 5,765 | 85,246,470 | 34,301,000 | 18,159,000 | 94,552,064 | ||
| 22 | Jan 18, 2026 06:18 | 5,767 | 85,538,125 | 28,259,000 | 24,222,000 | 94,674,944 | ||
| 23 | Jan 18, 2026 06:11 | 5,769 | 84,441,548 | 29,279,000 | 23,221,000 | 94,662,656 | ||
| 24 | Jan 18, 2026 06:11 | 5,777 | 83,130,092 | 29,317,000 | 23,251,000 | 94,662,656 | ||
| 25 | Jan 18, 2026 06:13 | 5,792 | 83,035,346 | 30,827,000 | 21,877,000 | 94,552,064 | ||
| 26 | Jan 18, 2026 06:18 | 5,795 | 79,843,006 | 30,424,000 | 22,311,000 | 94,670,848 | ||
| 27 | Jan 18, 2026 06:13 | 5,867 | 81,811,766 | 32,233,000 | 21,153,000 | 94,662,656 | ||
| 28 | Jan 18, 2026 06:13 | 5,901 | 79,122,646 | 30,826,000 | 22,871,000 | 94,670,848 | ||
| 29 | Jan 18, 2026 06:18 | 5,934 | 76,785,224 | 29,000,000 | 25,000,000 | 94,670,848 | ||
| 30 | Jan 18, 2026 06:11 | 5,956 | 80,736,139 | 29,106,000 | 25,091,000 | 94,670,848 |