We buffer the output and flush it from time to time to ensure that spooling does not impact performance.
SET FLUSH ON|OFF
can be used to control this.
If you find that immediately flushing has a large impact, you can selectively flush it out by re-spooling with an append, ie
spool myfile.out
command1
command2
command3
command4
spool off
becomes
spool myfile.out
command1
command2
spool myfile.out append
command3
command4
spool off