Smash the Code - Python3 slow input (90ms)

The reading of the color blocks is extremely slow for some reason.

Even with the sample code, just timing the input of the colors takes about 90ms on average (on the first turn it can take 200+)

Reading the other input lines works fast, just the color section is slow

import sys
import math
import time

# game loop
while True:
    start = time.perf_counter()
    for i in range(8):
        color_a, color_b = [int(j) for j in input().split()]

    print('This takes way too long', (time.perf_counter()-start)*1000, file=sys.stderr)
    for i in range(12):
        row = input()
    for i in range(12):
        row = input()  # One line of the map ('.' = empty, '0' = skull block, '1' to '5' = colored block)

    print("0 1")

This seems to be the case in almost all languages, however my tests showed that it doesn’t matter how long it takes to read in the data, you still get 100 [ms] of computation time after that. Granted, my tests are in Java, so it may differ for python.

The players do not play at the same time, your program is interrupted while the other play. So basically you are measuring the duration of the interruption + the time to read the input.

For instance if I run your code against eldidou, it gives me 97ms. Against itself it gives me 10ms. That’s more or less the time needed to read the input.

I think you are right, what I’m seeing is the time of the other player.
It’s just the first line of input that is hanging, everything after that is my time.