MySQL write performance after truncate & optimize
TRUNCATE TABLE throws away the table and creates a new, empty table, with the same schema.  There is nothing left to OPTIMIZE.
If you are really throwing away the data, why did you keep it?  Or, maybe you would prefer to toss the &quot;oldest&quot; part of the data each week?  And do it with virtually no impact on writes?  If so, you have a classic case for PARTITIONing.  Use PARTITION BY RANGE(TO_DAYS(..)) and a weekly task to DROP the  oldest partition and deal with making a new partition.  Details:  http://mysql.rjweb.org/doc.php/partitionmaint
Be sure to have innodb_file_per_table=ON.
(If this does not address your Question, please elaborate on it.)