
Add up every byte the parser walks over while it reads the whole buffer.
February 2021. A player gets tired of GTA Online taking six minutes to load, attaches a debugger to the running game, and finds a single thread grinding through a 10 MB list of shop items. Before reading each item the parser measured everything still ahead of it in the buffer, so the work grew with the square of the file. Rockstar paid the bounty, and load times dropped by about seventy percent. Count what the old parser was actually reading.
bytes_scanned({2,3}, 2)Expected result
8For your own tracking. Tests grade your code.
bytes_scanned({1,1,1}, 3)Expected result
6bytes_scanned({10}, 1)Expected result
10Expected files
parse.cAllowed functions
None. Write every helper yourself.
