freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype][gsoc-2023-ahmet-final] [tohtml] folding long li


From: @goksu
Subject: [Git][freetype/freetype][gsoc-2023-ahmet-final] [tohtml] folding long lines
Date: Mon, 25 Sep 2023 08:08:28 +0000

Ahmet Göksu pushed to branch gsoc-2023-ahmet-final at FreeType / FreeType

Commits:

  • 55fbde52
    by goksu at 2023-09-25T11:08:08+03:00
    [tohtml] folding long lines
    

1 changed file:

Changes:

  • src/tools/ftbench/src/tohtml.py
    ... ... @@ -39,7 +39,9 @@ FONT_COUNT = 5
    39 39
     
    
    40 40
     WARNING_SAME_COMMIT = "Warning: Baseline and Benchmark have the same commit ID!"
    
    41 41
     INFO_1 = "* Average time for single iteration. Smaller values are better."
    
    42
    -INFO_2 = "* If a value in the 'Iterations' column is given as '<i>x | y</i>', values <i>x</i> and <i>y</i> give the number of iterations in the baseline and the benchmark test, respectively."
    
    42
    +INFO_2 = "* If a value in the 'Iterations' column is given as '<i>x | y</i>',\
    
    43
    +    values <i>x</i> and <i>y</i> give the number of iterations in the baseline \
    
    44
    +        and the benchmark test, respectively."
    
    43 45
     
    
    44 46
     
    
    45 47
     def main():
    
    ... ... @@ -112,7 +114,8 @@ def generate_info_table(html_file, baseline_info, benchmark_info):
    112 114
         ):
    
    113 115
             write_to_html(
    
    114 116
                 html_file,
    
    115
    -            f'<tr><td class="col1">{info}</td><td>{baseline_line.strip()}</td><td>{benchmark_line.strip()}</td></tr>\n'
    
    117
    +            f'<tr><td class="col1">{info}</td><td>{baseline_line.strip()}</td>\
    
    118
    +                <td>{benchmark_line.strip()}</td></tr>\n'
    
    116 119
             )
    
    117 120
         write_to_html(html_file, "</table><br/>")
    
    118 121
         write_to_html(html_file, f"<p>{INFO_1}</p>")
    
    ... ... @@ -124,7 +127,10 @@ def generate_total_results_table(html_file, baseline_dir, benchmark_dir):
    124 127
     
    
    125 128
         # This dictionary will store aggregated results.
    
    126 129
         test_results = {
    
    127
    -        test: {"baseline": 0, "benchmark": 0, "n_baseline": 0, "n_benchmark": 0}
    
    130
    +        test: {"baseline": 0,
    
    131
    +               "benchmark": 0,
    
    132
    +               "n_baseline": 0,
    
    133
    +               "n_benchmark": 0}
    
    128 134
             for test in [
    
    129 135
                 "Load",
    
    130 136
                 "Load_Advances (Normal)",
    
    ... ... @@ -166,11 +172,11 @@ def generate_total_results_table(html_file, baseline_dir, benchmark_dir):
    166 172
     
    
    167 173
                     if baseline_line.startswith("  "):
    
    168 174
                         baseline_match = re.match(
    
    169
    -                        r"\s+(.*?)\s+(\d+\.\d+)\s+microseconds\s+(\d+)\s", baseline_line)
    
    175
    +                        r"\s+(.*?)\s+(\d+\.\d+)\s+microseconds\s+(\d+)\s",
    
    176
    +                        baseline_line)
    
    170 177
                         benchmark_match = re.match(
    
    171 178
                             r"\s+(.*?)\s+(\d+\.\d+)\s+microseconds\s+(\d+)\s",
    
    172
    -                        benchmark_line,
    
    173
    -                    )
    
    179
    +                        benchmark_line)
    
    174 180
     
    
    175 181
                         if baseline_match and benchmark_match:
    
    176 182
                             test = baseline_match.group(1).strip()
    
    ... ... @@ -229,12 +235,14 @@ def generate_total_results_table(html_file, baseline_dir, benchmark_dir):
    229 235
                 html_file,
    
    230 236
                 f'<tr><td class="col1">{test}</td><td>{n_display}</td>\
    
    231 237
                 <td class="{baseline_color}">{baseline:.1f}</td>\
    
    232
    -            <td class="{benchmark_color}">{benchmark:.1f}</td><td>{diff:.1f}</td></tr>\n',
    
    238
    +            <td class="{benchmark_color}">{benchmark:.1f}</td>\
    
    239
    +                <td>{diff:.1f}</td></tr>\n',
    
    233 240
             )
    
    234 241
     
    
    235 242
         write_to_html(
    
    236 243
             html_file,
    
    237
    -        f'<tr><td class="col1">Total duration for all tests:</td><td class="col1" colspan="4">{total_time:.0f} s</td>',
    
    244
    +        f'<tr><td class="col1">Total duration for all tests:</td>\
    
    245
    +            <td class="col1" colspan="4">{total_time:.0f} s</td>',
    
    238 246
         )
    
    239 247
     
    
    240 248
         write_to_html(html_file, "</table>\n")
    
    ... ... @@ -257,9 +265,9 @@ def generate_results_table(
    257 265
         write_to_html(
    
    258 266
             html_file,
    
    259 267
             f'<tr><th>Test</th><th>Iterations</th>\
    
    260
    -        <th>* <a href="">"{ os.path.join("./baseline/", filename[:-4])}.txt">Baseline</a> (&#181;s)</th>\
    
    261
    -        <th>* <a href="">"{ os.path.join("./benchmark/", filename[:-4])}.txt">Benchmark</a> (&#181;s)</th>\
    
    262
    -        <th>Difference (%)</th></tr>\n'
    
    268
    +            <th>* <a href="">"{ os.path.join("./baseline/", filename[:-4])}.txt">Baseline</a> (&#181;s)</th>\
    
    269
    +            <th>* <a href="">"{ os.path.join("./benchmark/", filename[:-4])}.txt">Benchmark</a> (&#181;s)</th>\
    
    270
    +            <th>Difference (%)</th></tr>\n'
    
    263 271
         )
    
    264 272
     
    
    265 273
         total_n = total_time = 0
    
    ... ... @@ -315,13 +323,17 @@ def generate_results_table(
    315 323
     
    
    316 324
                     write_to_html(
    
    317 325
                         html_file,
    
    318
    -                    f'<tr><td class="col1">{baseline_match.group(1)}</td><td>{n}</td>\
    
    319
    -                    <td class="{baseline_color}">{baseline_value:.1f}</td><td class="{benchmark_color}">{benchmark_value:.1f}</td><td>{percentage_diff:.1f}</td></tr>\n',
    
    326
    +                    f'<tr><td class="col1">{baseline_match.group(1)}</td>\
    
    327
    +                        <td>{n}</td>\
    
    328
    +                        <td class="{baseline_color}">{baseline_value:.1f}</td>\
    
    329
    +                        <td class="{benchmark_color}">{benchmark_value:.1f}</td>\
    
    330
    +                        <td>{percentage_diff:.1f}</td></tr>\n',
    
    320 331
                     )
    
    321 332
     
    
    322 333
         write_to_html(
    
    323 334
             html_file,
    
    324
    -        f'<tr><td class="col1">Total duration for the font:</td><td class="col1" colspan="4">{total_time:.0f} s</td></table>\n',
    
    335
    +        f'<tr><td class="col1">Total duration for the font:</td>\
    
    336
    +            <td class="col1" colspan="4">{total_time:.0f} s</td></table>\n',
    
    325 337
         )
    
    326 338
     
    
    327 339
     
    


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]