When builing large strings with lots of concatenations in PL/SQL, custom approach like "use varchar2(32000) buffer to reduce the number of dbms_lob calls" makes sense even for Oracle 18.104.22.168.0.
The response time improvement is 4..300+ times :) depending on the DB version and API you use.
Note that simple
v_clob || TO_CHAR (SYSTIMESTAMP) || ', ' ==>
v_clob || TO_CLOB(TO_CHAR (SYSTIMESTAMP) || ', ') trick
(note the extra
to_clob) makes 24 times improvement for 11g. The trick is bad for 12c where results in 1.5x degradation.
The code was published 4 year ago as an answer to "How to Quickly Append VARCHAR2 to CLOB": http://www.talkapex.com/2009/06/how-to-quickly-append-varchar2-to-clob.html?showComment=1343235921606#c9077980873875311325