Set the default save config also in tracy-update.

This commit is contained in:
Bartosz Taudul 2024-06-02 17:29:21 +02:00
parent 0a187a65f6
commit abf12f79c5
No known key found for this signature in database
GPG Key ID: B7FE2008B7575DF3
3 changed files with 17 additions and 13 deletions

5
NEWS
View File

@ -123,9 +123,8 @@ vx.xx.x (xxxx-xx-xx)
- Implemented retrieval of kernel symbol code on Linux.
- Added support for multiple compression streams in trace files. This
effectively parallelizes both load and save operations.
- The default save configuration in tracy-profiler and tracy-update is
now set to Zstd level 3 with 4 compression streams. This gives both
shorter compression time and smaller file size.
- The default save setup is now set to Zstd level 3 with 4 compression
streams. This gives both faster compression time and smaller file size.
v0.10.0 (2023-10-16)

View File

@ -2682,12 +2682,13 @@ The new file contains the same data as the old one but with an updated internal
The \texttt{update} utility supports optional higher levels of data compression, which reduce disk size of traces at the cost of increased compression times. The output files have a reasonable size and are quick to save and load with the default settings. A list of available compression modes and their respective results is available in table~\ref{compressiontimes} and figures~\ref{savesize}, \ref{savetime} and~\ref{loadtime}. The following command-line options control compression mode selection:
\begin{itemize}
\item \texttt{-4} -- selects LZ4 algorithm.
\item \texttt{-h} -- enables LZ4 HC compression.
\item \texttt{-e} -- uses LZ4 extreme compression.
\item \texttt{-z level} -- selects Zstandard algorithm, with a specified compression level.
\end{itemize}
\begin{table}[h]
\begin{table}
\centering
\begin{tabular}[h]{c|c|c|c|c}
\textbf{Mode} & \textbf{Size} & \textbf{Ratio} & \textbf{Save time} & \textbf{Load time} \\ \hline
@ -2721,7 +2722,7 @@ zstd 22 & 45.52 MB & 4.81\% & 15:11 & 621 \si{\milli\second}
\label{compressiontimes}
\end{table}
\begin{figure}[h]
\begin{figure}
\begin{minipage}[c]{.475\textwidth}
\begin{figure}[H]
\centering\begin{tikzpicture}
@ -2765,7 +2766,7 @@ zstd 22 & 45.52 MB & 4.81\% & 15:11 & 621 \si{\milli\second}
\end{minipage}
\end{figure}
\begin{figure}[H]
\begin{figure}
\centering\begin{tikzpicture}
\begin{axis}[xlabel=Mode,ylabel=Time (ms), legend pos=south west, width=0.475\textwidth]
\addplot[mark=x, red] plot coordinates {
@ -2784,7 +2785,7 @@ zstd 22 & 45.52 MB & 4.81\% & 15:11 & 621 \si{\milli\second}
\label{loadtime}
\end{figure}
Trace files created using the \emph{default}, \emph{hc} and \emph{extreme} modes are optimized for fast decompression and can be further compressed using file compression utilities. For example, using 7-zip results in archives of the following sizes: 77.2 MB, 54.3 MB, 52.4 MB.
Trace files created using the \emph{lz4}, \emph{lz4 hc} and \emph{lz4 extreme} modes are optimized for fast decompression and can be further compressed using file compression utilities. For example, using 7-zip results in archives of the following sizes: 77.2 MB, 54.3 MB, 52.4 MB.
For archival purposes, it is, however, much better to use the \emph{zstd} compression modes, which are faster, compress trace files more tightly, and are directly loadable by the profiler, without the intermediate decompression step.
@ -2794,7 +2795,7 @@ Saving and loading trace data can be parallelized using the \texttt{-j streams}
Going overboard with the number of streams is not recommended, especially with the fast compression modes where it will be difficult to keep each stream busy. Also, complex compression codecs (e.g. zstd at level 22) have significantly worse compression rates when the work is divided. This is a fairly nuanced topic, and you are encouraged to do your own measurements, but for a rough guideline on the behavior, you can refer to tables~\ref{streamsize} and~\ref{streamspeedup}.
\begin{table}[h]
\begin{table}
\centering
\begin{tabular}{c|c|c|c|c}
\diagbox[font=\footnotesize,width=5.25em,trim=lr]{\textbf{Mode}}{\textbf{Streams}} & \textbf{4} & \textbf{8} & \textbf{16} & \textbf{32} \\ \hline
@ -2812,7 +2813,7 @@ Going overboard with the number of streams is not recommended, especially with t
\label{streamsize}
\end{table}
\begin{table}[h]
\begin{table}
\centering
\begin{tabular}{c|c|c|c|c}
\diagbox[font=\footnotesize,width=5.25em,trim=lr]{\textbf{Mode}}{\textbf{Streams}} & \textbf{4} & \textbf{8} & \textbf{16} & \textbf{32} \\ \hline

View File

@ -26,6 +26,7 @@
void Usage()
{
printf( "Usage: update [options] input.tracy output.tracy\n\n" );
printf( " -4: enable LZ4 compression\n" );
printf( " -h: enable LZ4HC compression\n" );
printf( " -e: enable extreme LZ4HC compression (very slow)\n" );
printf( " -z level: use Zstd compression with given compression level\n" );
@ -51,20 +52,23 @@ int main( int argc, char** argv )
}
#endif
tracy::FileCompression clev = tracy::FileCompression::Fast;
tracy::FileCompression clev = tracy::FileCompression::Zstd;
uint32_t events = tracy::EventType::All;
int zstdLevel = 1;
int streams = 1;
int zstdLevel = 3;
int streams = 4;
bool buildDict = false;
bool cacheSource = false;
bool resolveSymbols = false;
std::vector<std::string> pathSubstitutions;
int c;
while( ( c = getopt( argc, argv, "hez:ds:crp:j:" ) ) != -1 )
while( ( c = getopt( argc, argv, "4hez:ds:crp:j:" ) ) != -1 )
{
switch( c )
{
case '4':
clev = tracy::FileCompression::Fast;
break;
case 'h':
clev = tracy::FileCompression::Slow;
break;