Hi Rosh,
The performance difference comes from the way semihosting works: while printing on ITM is done just by writing in a few registers, like writing on an UART (which is the way it works when writing through the STLink-V2-1 provided serail over USB link), semihosting generates an SWI instructioon with a predefined code, that is intercepted by OpenOCD (stopping the CPU execution) which has to read CPU registers (through the JTAG/SWD interface) then restart CPU execution.
Due to the stop/read/start sequence of debug interaction, semihosting is thus inherently slower than writing on a few registers without debug interaction.
Bernard (Ac6)