to test performance, just put that in a while (true) loop to avoid the penalty of going through the loop() overhead - you'll still see a bit of the jump overhead but more limited than the loop()
With an AVR chip you could do something like this
void setup() {
Serial.begin(115200);
top:
// turn bits on and off here with PORT for example
asm goto ("jmp %l0\n"::::top); // jump back to top label, infinite loop
}
void loop() {}
i've not tested it but this might do it - using an assembly line jump to be quick
void setup() {
top:
WRITE_PERI_REG( 0x60000304, 0x20 );
WRITE_PERI_REG( 0x60000308, 0x20 );
asm goto ("XXX"::::top); // XXX = right assembly language for the ESP chip to jump probably just "J"
}
void loop() {}