More than the memory you would have on a small PDP-6 LISP system! Enough to run PROLOG: :)
I wonder if uLisp is portable to the ESP.
They are surely more powerful that the Amstrad PC1512 that we used to play Defender of the Crown back in the high school computer club.
And MS-DOS had plenty of nice high level languages to choose from.
However even those 5ms might not be an issue, if the chip is doing single purpose tasks, like wake-up, do its thing, go to sleep, like opening a garage door, read a measurement and send it off, ...
That's not a lot of gap; openwrt is tiny and "embedded" boards grow more powerful every year. Every time I see a new board, one of my first questions is, "does it have enough RAM+flash for Linux?" and we're getting close - if the teensy 4.1 had a touch more ram it'd work (well, uclinux, but still).
We need more little systems that are somewhere between underpowered Arduinos and entire Linux systems.
If only Blackberry hadn't killed off open-source QNX. A board with a few megabytes of RAM and QNX in ROM would be a nice system for many embedded applications. You get processes, threads, message passing, and real-time scheduling. But disks, users accounts, networking, etc. are optional add-ons. Nice for embedded applications where you need to control hardware but have other things to do as well.