Yep, implementing a compiler with systems having 512 KB maximum on average did not leave too much space for clever optimizations.
Using compilers on 8 bit systems was even worse (max 64KB).
Many game studios used UNIX/VMS systems, with cross compilers to upload data into ZX and C64 computers as development cycle.