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
No challenges yet.
Run Statistics
| # | Date | Score | Wall Time | CPU User | CPU System | Memory | Error | |
|---|---|---|---|---|---|---|---|---|
| 1 | Apr 16, 2026 16:19 | 4,347 | 64,688,969 | 21,756,000 | 17,800,000 | 94,658,560 | ||
| 2 | Apr 16, 2026 16:19 | 4,350 | 69,832,121 | 22,763,000 | 16,824,000 | 94,760,960 | ||
| 3 | Apr 16, 2026 16:19 | 4,367 | 66,191,897 | 22,853,000 | 16,891,000 | 94,654,464 | ||
| 4 | Apr 16, 2026 16:26 | 4,371 | 64,825,564 | 20,882,000 | 18,894,000 | 94,769,152 | ||
| 5 | Apr 16, 2026 16:26 | 4,389 | 64,251,834 | 22,968,000 | 16,976,000 | 94,765,056 | ||
| 6 | Apr 16, 2026 16:22 | 4,397 | 62,999,787 | 23,008,000 | 17,006,000 | 94,658,560 | ||
| 7 | Apr 16, 2026 16:12 | 4,410 | 64,697,115 | 22,070,000 | 18,057,000 | 94,642,176 | ||
| 8 | Apr 16, 2026 16:22 | 4,414 | 62,950,541 | 24,100,000 | 16,067,000 | 94,658,560 | ||
| 9 | Apr 16, 2026 16:22 | 4,448 | 71,776,397 | 24,284,000 | 16,189,000 | 94,711,808 | ||
| 10 | Apr 16, 2026 16:26 | 4,463 | 69,387,691 | 19,810,000 | 20,800,000 | 94,642,176 | ||
| 11 | Apr 16, 2026 16:12 | 4,559 | 67,565,944 | 19,226,000 | 22,262,000 | 94,773,248 | ||
| 12 | Apr 16, 2026 17:05 | 4,613 | 68,583,968 | 26,984,000 | 14,991,000 | 94,658,560 | ||
| 13 | Apr 16, 2026 16:12 | 4,617 | 65,812,009 | 24,009,000 | 18,006,000 | 94,781,440 | ||
| 14 | Apr 16, 2026 17:05 | 4,619 | 70,817,504 | 26,023,000 | 16,014,000 | 94,658,560 | ||
| 15 | Apr 16, 2026 17:05 | 4,637 | 63,653,918 | 25,115,000 | 17,078,000 | 94,658,560 | ||
| 16 | Apr 16, 2026 19:59 | 4,854 | 69,304,434 | 30,117,000 | 14,054,000 | 94,642,176 | ||
| 17 | Apr 16, 2026 19:59 | 4,861 | 68,599,362 | 26,141,000 | 18,097,000 | 94,658,560 | ||
| 18 | Apr 16, 2026 19:59 | 4,911 | 70,150,111 | 27,808,000 | 16,883,000 | 94,769,152 | ||
| 19 | Apr 16, 2026 17:17 | 5,367 | 73,272,315 | 31,894,000 | 16,944,000 | 94,658,560 | ||
| 20 | Apr 16, 2026 17:17 | 5,376 | 70,734,147 | 28,952,000 | 19,967,000 | 94,642,176 | ||
| 21 | Apr 16, 2026 17:17 | 5,384 | 72,055,393 | 28,999,000 | 19,999,000 | 94,658,560 | ||
| 22 | Apr 16, 2026 16:57 | 5,511 | 77,820,150 | 29,086,000 | 21,062,000 | 94,609,408 | ||
| 23 | Apr 16, 2026 16:57 | 5,514 | 75,152,803 | 31,111,000 | 19,068,000 | 94,621,696 | ||
| 24 | Apr 16, 2026 16:57 | 5,530 | 80,711,290 | 32,208,000 | 18,117,000 | 94,773,248 | ||
| 25 | Apr 16, 2026 17:23 | 5,634 | 74,044,945 | 32,170,000 | 19,101,000 | 94,707,712 | ||
| 26 | Apr 16, 2026 17:23 | 5,635 | 73,791,810 | 32,176,000 | 19,105,000 | 94,621,696 | ||
| 27 | Apr 16, 2026 17:23 | 5,659 | 82,570,598 | 34,329,000 | 17,164,000 | 94,650,368 | ||
| 28 | Apr 16, 2026 19:46 | 6,660 | 90,012,475 | 41,728,000 | 18,877,000 | 94,781,440 | ||
| 29 | Apr 16, 2026 19:46 | 6,661 | 83,659,207 | 42,732,000 | 17,887,000 | 94,769,152 | ||
| 30 | Apr 16, 2026 19:46 | 6,708 | 85,182,236 | 43,029,000 | 18,012,000 | 94,760,960 | ||
| 31 | Mar 21, 2026 12:06 | 7,875 | 99,353,187 | 54,744,000 | 16,921,000 | 94,658,560 | ||
| 32 | Mar 21, 2026 12:06 | 7,903 | 102,648,024 | 56,936,000 | 14,983,000 | 94,777,344 | ||
| 33 | Mar 21, 2026 12:06 | 7,969 | 98,402,356 | 55,397,000 | 17,122,000 | 94,638,080 | ||
| 34 | Mar 20, 2026 05:52 | 8,611 | 107,572,406 | 61,285,000 | 17,079,000 | 94,658,560 | ||
| 35 | Mar 20, 2026 05:52 | 8,647 | 105,400,891 | 62,752,000 | 15,937,000 | 94,617,600 | ||
| 36 | Mar 20, 2026 05:52 | 8,656 | 103,792,962 | 62,814,000 | 15,952,000 | 94,642,176 | ||
| 37 | Apr 7, 2026 00:03 | 8,887 | 103,822,445 | 64,900,000 | 15,975,000 | 94,658,560 | ||
| 38 | Mar 21, 2026 04:10 | 8,929 | 112,054,339 | 62,197,000 | 19,060,000 | 94,621,696 | ||
| 39 | Apr 7, 2026 00:03 | 8,932 | 106,240,496 | 62,218,000 | 19,066,000 | 94,785,536 | ||
| 40 | Mar 20, 2026 05:58 | 8,939 | 107,598,303 | 62,261,000 | 19,080,000 | 94,773,248 | ||
| 41 | Apr 7, 2026 05:16 | 8,947 | 106,504,283 | 60,313,000 | 21,109,000 | 94,658,560 | ||
| 42 | Apr 7, 2026 05:16 | 8,952 | 110,139,198 | 64,578,000 | 16,889,000 | 94,773,248 | ||
| 43 | Mar 20, 2026 05:58 | 8,970 | 105,369,093 | 64,708,000 | 16,923,000 | 94,773,248 | ||
| 44 | Apr 7, 2026 00:03 | 8,977 | 118,243,106 | 63,758,000 | 17,932,000 | 94,744,576 | ||
| 45 | Apr 7, 2026 05:16 | 8,977 | 108,765,269 | 65,749,000 | 15,939,000 | 94,642,176 | ||
| 46 | Mar 20, 2026 05:58 | 8,990 | 110,844,385 | 63,851,000 | 17,958,000 | 94,765,056 | ||
| 47 | Mar 21, 2026 04:10 | 9,010 | 108,815,627 | 64,992,000 | 16,998,000 | 94,638,080 | ||
| 48 | Mar 21, 2026 04:10 | 9,145 | 122,365,544 | 63,409,000 | 19,815,000 | 94,650,368 |