Ahmet Göksu pushed to branch GSoC-2023-Ahmet at FreeType / FreeType
Commits:
3 changed files:
Changes:
builds/testing.mk
... |
... |
@@ -3,7 +3,7 @@ FTBENCH_DIR = $(TOP_DIR)/src/tools/ftbench |
3
|
3
|
FTBENCH_SRC = $(FTBENCH_DIR)/ftbench.c
|
4
|
4
|
FTBENCH_OBJ = $(OBJ_DIR)/bench.$(SO)
|
5
|
5
|
FTBENCH_BIN = $(OBJ_DIR)/bench$E
|
6
|
|
-FTBENCH_FLAG ?= -c 550 -w 50
|
|
6
|
+FTBENCH_FLAG ?= -c 750 -w 50
|
7
|
7
|
INCLUDES = $(TOP_DIR)/include
|
8
|
8
|
FONTS = $(wildcard $(FTBENCH_DIR)/fonts/*.ttf)
|
9
|
9
|
BASELINE_DIR = $(OBJ_DIR)/baseline/
|
src/tools/ftbench/ftbench.c
... |
... |
@@ -66,8 +66,7 @@ |
66
|
66
|
|
67
|
67
|
|
68
|
68
|
typedef int
|
69
|
|
- (*bcall_t)( btimer_t* timer,
|
70
|
|
- FT_Face face,
|
|
69
|
+ (*bcall_t)( FT_Face face,
|
71
|
70
|
void* user_data );
|
72
|
71
|
|
73
|
72
|
|
... |
... |
@@ -260,7 +259,7 @@ |
260
|
259
|
#define TIMER_GET( timer ) ( timer )->total
|
261
|
260
|
#define TIMER_RESET( timer ) ( timer )->total = 0
|
262
|
261
|
|
263
|
|
-#define CHUNK_SIZE 100
|
|
262
|
+#define CHUNK_SIZE 50
|
264
|
263
|
|
265
|
264
|
int compare(const void* a, const void* b) {
|
266
|
265
|
if (*(double*)a > *(double*)b) return 1;
|
... |
... |
@@ -271,53 +270,44 @@ int compare(const void* a, const void* b) { |
271
|
270
|
static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time, double warmup) {
|
272
|
271
|
int n, done;
|
273
|
272
|
int total_done = 0; // track total iterations done across all chunks
|
274
|
|
- btimer_t timer, elapsed;
|
|
273
|
+ double total_time = 0.0;
|
|
274
|
+ btimer_t timer;
|
275
|
275
|
|
276
|
276
|
int NUM_CHUNKS = max_iter / CHUNK_SIZE;
|
277
|
277
|
double medians[NUM_CHUNKS];
|
278
|
|
- double errors[NUM_CHUNKS];
|
279
|
278
|
|
280
|
|
- if (test->cache_first) {
|
281
|
|
- TIMER_RESET(&timer);
|
282
|
|
- test->bench(&timer, face, test->user_data);
|
283
|
|
- }
|
284
|
|
-
|
285
|
|
- // Initial warm-up
|
286
|
|
- for (n = 0; n < warmup; n++) {
|
287
|
|
- test->bench(&timer, face, test->user_data);
|
|
279
|
+ // Cache and warmup
|
|
280
|
+ if (test->cache_first) {
|
|
281
|
+ TIMER_START(&timer);
|
|
282
|
+ for(int i = 0; i<1+warmup; i++)
|
|
283
|
+ test->bench(face, test->user_data);
|
|
284
|
+ TIMER_STOP(&timer);
|
288
|
285
|
}
|
289
|
|
-
|
|
286
|
+
|
290
|
287
|
printf(" %-25s ", test->title);
|
291
|
288
|
fflush(stdout);
|
292
|
289
|
|
293
|
290
|
for (int chunk = 0; chunk < NUM_CHUNKS; chunk++) {
|
294
|
|
- double chunk_results[CHUNK_SIZE];
|
295
|
291
|
TIMER_RESET(&timer);
|
296
|
|
- TIMER_RESET(&elapsed);
|
|
292
|
+ TIMER_START(&timer);
|
297
|
293
|
|
298
|
294
|
// Execute a chunk of iterations
|
299
|
|
- for (n = 0, done = 0; n < CHUNK_SIZE; n++) {
|
300
|
|
- TIMER_START(&elapsed);
|
301
|
|
- done += test->bench(&timer, face, test->user_data);
|
302
|
|
- TIMER_STOP(&elapsed);
|
303
|
|
- chunk_results[n] = TIMER_GET(&elapsed);
|
304
|
|
-
|
305
|
|
- // Check max_time for each iteration, break if exceeded
|
306
|
|
- if (TIMER_GET(&elapsed) > 1E6 * max_time) {
|
307
|
|
- break;
|
308
|
|
- }
|
|
295
|
+ for (n = 0, done = 0; n < CHUNK_SIZE; n++) {
|
|
296
|
+ done += test->bench(face, test->user_data);
|
309
|
297
|
}
|
|
298
|
+ TIMER_STOP(&timer);
|
|
299
|
+ medians[chunk] = TIMER_GET(&timer);
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+ total_time += medians[chunk];
|
310
|
303
|
total_done += done;
|
311
|
304
|
|
312
|
|
- qsort(chunk_results, CHUNK_SIZE, sizeof(double), compare);
|
313
|
|
- if (CHUNK_SIZE % 2 == 0) {
|
314
|
|
- medians[chunk] = (chunk_results[CHUNK_SIZE / 2 - 1] + chunk_results[CHUNK_SIZE / 2]) / 2.0;
|
315
|
|
- } else {
|
316
|
|
- medians[chunk] = chunk_results[CHUNK_SIZE / 2];
|
317
|
|
- }
|
318
|
|
- errors[chunk] = chunk_results[91 * CHUNK_SIZE / 100] - chunk_results[10 * CHUNK_SIZE / 100];
|
|
305
|
+ // Check max_time for each iteration, break if exceeded
|
|
306
|
+ if (total_time > 1E6 * max_time)
|
|
307
|
+ break;
|
|
308
|
+
|
319
|
309
|
}
|
320
|
|
-
|
|
310
|
+
|
321
|
311
|
qsort(medians, NUM_CHUNKS, sizeof(double), compare);
|
322
|
312
|
double final_median;
|
323
|
313
|
if (NUM_CHUNKS % 2 == 0) {
|
... |
... |
@@ -326,7 +316,7 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
326
|
316
|
final_median = medians[NUM_CHUNKS / 2];
|
327
|
317
|
}
|
328
|
318
|
|
329
|
|
- printf("%10.1f microseconds %10d done\n", final_median, total_done);
|
|
319
|
+ printf("%10.1f microseconds %10d done\n", final_median/CHUNK_SIZE, total_done);
|
330
|
320
|
}
|
331
|
321
|
|
332
|
322
|
/*
|
... |
... |
@@ -334,8 +324,7 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
334
|
324
|
*/
|
335
|
325
|
|
336
|
326
|
static int
|
337
|
|
- test_load( btimer_t* timer,
|
338
|
|
- FT_Face face,
|
|
327
|
+ test_load( FT_Face face,
|
339
|
328
|
void* user_data )
|
340
|
329
|
{
|
341
|
330
|
int i, done = 0;
|
... |
... |
@@ -343,23 +332,18 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
343
|
332
|
FT_UNUSED( user_data );
|
344
|
333
|
|
345
|
334
|
|
346
|
|
- TIMER_START( timer );
|
347
|
|
-
|
348
|
335
|
FOREACH( i )
|
349
|
336
|
{
|
350
|
337
|
if ( !FT_Load_Glyph( face, (FT_UInt)i, load_flags ) )
|
351
|
338
|
done++;
|
352
|
339
|
}
|
353
|
340
|
|
354
|
|
- TIMER_STOP( timer );
|
355
|
|
-
|
356
|
341
|
return done;
|
357
|
342
|
}
|
358
|
343
|
|
359
|
344
|
|
360
|
345
|
static int
|
361
|
|
- test_load_advances( btimer_t* timer,
|
362
|
|
- FT_Face face,
|
|
346
|
+ test_load_advances( FT_Face face,
|
363
|
347
|
void* user_data )
|
364
|
348
|
{
|
365
|
349
|
int done = 0;
|
... |
... |
@@ -381,15 +365,11 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
381
|
365
|
|
382
|
366
|
advances = (FT_Fixed *)calloc( sizeof ( FT_Fixed ), (size_t)count );
|
383
|
367
|
|
384
|
|
- TIMER_START( timer );
|
385
|
|
-
|
386
|
368
|
FT_Get_Advances( face,
|
387
|
369
|
(FT_UInt)start, (FT_UInt)count,
|
388
|
370
|
(FT_Int32)flags, advances );
|
389
|
371
|
done += (int)count;
|
390
|
372
|
|
391
|
|
- TIMER_STOP( timer );
|
392
|
|
-
|
393
|
373
|
free( advances );
|
394
|
374
|
|
395
|
375
|
return done;
|
... |
... |
@@ -397,8 +377,7 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
397
|
377
|
|
398
|
378
|
|
399
|
379
|
static int
|
400
|
|
- test_render( btimer_t* timer,
|
401
|
|
- FT_Face face,
|
|
380
|
+ test_render( FT_Face face,
|
402
|
381
|
void* user_data )
|
403
|
382
|
{
|
404
|
383
|
int i, done = 0;
|
... |
... |
@@ -411,10 +390,8 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
411
|
390
|
if ( FT_Load_Glyph( face, (FT_UInt)i, load_flags ) )
|
412
|
391
|
continue;
|
413
|
392
|
|
414
|
|
- TIMER_START( timer );
|
415
|
393
|
if ( !FT_Render_Glyph( face->glyph, render_mode ) )
|
416
|
394
|
done++;
|
417
|
|
- TIMER_STOP( timer );
|
418
|
395
|
}
|
419
|
396
|
|
420
|
397
|
return done;
|
... |
... |
@@ -422,8 +399,7 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
422
|
399
|
|
423
|
400
|
|
424
|
401
|
static int
|
425
|
|
- test_embolden( btimer_t* timer,
|
426
|
|
- FT_Face face,
|
|
402
|
+ test_embolden( FT_Face face,
|
427
|
403
|
void* user_data )
|
428
|
404
|
{
|
429
|
405
|
int i, done = 0;
|
... |
... |
@@ -436,10 +412,8 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
436
|
412
|
if ( FT_Load_Glyph( face, (FT_UInt)i, load_flags ) )
|
437
|
413
|
continue;
|
438
|
414
|
|
439
|
|
- TIMER_START( timer );
|
440
|
415
|
FT_GlyphSlot_Embolden( face->glyph );
|
441
|
416
|
done++;
|
442
|
|
- TIMER_STOP( timer );
|
443
|
417
|
}
|
444
|
418
|
|
445
|
419
|
return done;
|
... |
... |
@@ -447,8 +421,7 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
447
|
421
|
|
448
|
422
|
|
449
|
423
|
static int
|
450
|
|
- test_stroke( btimer_t* timer,
|
451
|
|
- FT_Face face,
|
|
424
|
+ test_stroke( FT_Face face,
|
452
|
425
|
void* user_data )
|
453
|
426
|
{
|
454
|
427
|
FT_Glyph glyph;
|
... |
... |
@@ -472,9 +445,7 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
472
|
445
|
FT_Get_Glyph( face->glyph, &glyph ) )
|
473
|
446
|
continue;
|
474
|
447
|
|
475
|
|
- TIMER_START( timer );
|
476
|
448
|
FT_Glyph_Stroke( &glyph, stroker, 1 );
|
477
|
|
- TIMER_STOP( timer );
|
478
|
449
|
|
479
|
450
|
FT_Done_Glyph( glyph );
|
480
|
451
|
done++;
|
... |
... |
@@ -487,8 +458,7 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
487
|
458
|
|
488
|
459
|
|
489
|
460
|
static int
|
490
|
|
- test_get_glyph( btimer_t* timer,
|
491
|
|
- FT_Face face,
|
|
461
|
+ test_get_glyph( FT_Face face,
|
492
|
462
|
void* user_data )
|
493
|
463
|
{
|
494
|
464
|
FT_Glyph glyph;
|
... |
... |
@@ -503,13 +473,11 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
503
|
473
|
if ( FT_Load_Glyph( face, (FT_UInt)i, load_flags ) )
|
504
|
474
|
continue;
|
505
|
475
|
|
506
|
|
- TIMER_START( timer );
|
507
|
476
|
if ( !FT_Get_Glyph( face->glyph, &glyph ) )
|
508
|
477
|
{
|
509
|
478
|
FT_Done_Glyph( glyph );
|
510
|
479
|
done++;
|
511
|
480
|
}
|
512
|
|
- TIMER_STOP( timer );
|
513
|
481
|
}
|
514
|
482
|
|
515
|
483
|
return done;
|
... |
... |
@@ -517,8 +485,7 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
517
|
485
|
|
518
|
486
|
|
519
|
487
|
static int
|
520
|
|
- test_get_cbox( btimer_t* timer,
|
521
|
|
- FT_Face face,
|
|
488
|
+ test_get_cbox( FT_Face face,
|
522
|
489
|
void* user_data )
|
523
|
490
|
{
|
524
|
491
|
FT_Glyph glyph;
|
... |
... |
@@ -537,10 +504,8 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
537
|
504
|
if ( FT_Get_Glyph( face->glyph, &glyph ) )
|
538
|
505
|
continue;
|
539
|
506
|
|
540
|
|
- TIMER_START( timer );
|
541
|
507
|
FT_Glyph_Get_CBox( glyph, FT_GLYPH_BBOX_PIXELS, &bbox );
|
542
|
|
- TIMER_STOP( timer );
|
543
|
|
-
|
|
508
|
+
|
544
|
509
|
FT_Done_Glyph( glyph );
|
545
|
510
|
done++;
|
546
|
511
|
}
|
... |
... |
@@ -550,8 +515,7 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
550
|
515
|
|
551
|
516
|
|
552
|
517
|
static int
|
553
|
|
- test_get_bbox( btimer_t* timer,
|
554
|
|
- FT_Face face,
|
|
518
|
+ test_get_bbox( FT_Face face,
|
555
|
519
|
void* user_data )
|
556
|
520
|
{
|
557
|
521
|
FT_BBox bbox;
|
... |
... |
@@ -566,9 +530,7 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
566
|
530
|
if ( FT_Load_Glyph( face, (FT_UInt)i, load_flags ) )
|
567
|
531
|
continue;
|
568
|
532
|
|
569
|
|
- TIMER_START( timer );
|
570
|
533
|
FT_Outline_Get_BBox( &face->glyph->outline, &bbox );
|
571
|
|
- TIMER_STOP( timer );
|
572
|
534
|
|
573
|
535
|
done++;
|
574
|
536
|
}
|
... |
... |
@@ -578,31 +540,25 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
578
|
540
|
|
579
|
541
|
|
580
|
542
|
static int
|
581
|
|
- test_get_char_index( btimer_t* timer,
|
582
|
|
- FT_Face face,
|
|
543
|
+ test_get_char_index( FT_Face face,
|
583
|
544
|
void* user_data )
|
584
|
545
|
{
|
585
|
546
|
bcharset_t* charset = (bcharset_t*)user_data;
|
586
|
547
|
int i, done = 0;
|
587
|
548
|
|
588
|
549
|
|
589
|
|
- TIMER_START( timer );
|
590
|
|
-
|
591
|
550
|
for ( i = 0; i < charset->size; i++ )
|
592
|
551
|
{
|
593
|
552
|
if ( FT_Get_Char_Index(face, charset->code[i]) )
|
594
|
553
|
done++;
|
595
|
554
|
}
|
596
|
555
|
|
597
|
|
- TIMER_STOP( timer );
|
598
|
|
-
|
599
|
556
|
return done;
|
600
|
557
|
}
|
601
|
558
|
|
602
|
559
|
|
603
|
560
|
static int
|
604
|
|
- test_cmap_cache( btimer_t* timer,
|
605
|
|
- FT_Face face,
|
|
561
|
+ test_cmap_cache( FT_Face face,
|
606
|
562
|
void* user_data )
|
607
|
563
|
{
|
608
|
564
|
bcharset_t* charset = (bcharset_t*)user_data;
|
... |
... |
@@ -611,8 +567,6 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
611
|
567
|
FT_UNUSED( face );
|
612
|
568
|
|
613
|
569
|
|
614
|
|
- TIMER_START( timer );
|
615
|
|
-
|
616
|
570
|
for ( i = 0; i < charset->size; i++ )
|
617
|
571
|
{
|
618
|
572
|
if ( FTC_CMapCache_Lookup( cmap_cache,
|
... |
... |
@@ -622,15 +576,12 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
622
|
576
|
done++;
|
623
|
577
|
}
|
624
|
578
|
|
625
|
|
- TIMER_STOP( timer );
|
626
|
|
-
|
627
|
579
|
return done;
|
628
|
580
|
}
|
629
|
581
|
|
630
|
582
|
|
631
|
583
|
static int
|
632
|
|
- test_image_cache( btimer_t* timer,
|
633
|
|
- FT_Face face,
|
|
584
|
+ test_image_cache( FT_Face face,
|
634
|
585
|
void* user_data )
|
635
|
586
|
{
|
636
|
587
|
FT_Glyph glyph;
|
... |
... |
@@ -640,9 +591,6 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
640
|
591
|
FT_UNUSED( face );
|
641
|
592
|
FT_UNUSED( user_data );
|
642
|
593
|
|
643
|
|
-
|
644
|
|
- TIMER_START( timer );
|
645
|
|
-
|
646
|
594
|
FOREACH( i )
|
647
|
595
|
{
|
648
|
596
|
if ( !FTC_ImageCache_Lookup( image_cache,
|
... |
... |
@@ -653,15 +601,12 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
653
|
601
|
done++;
|
654
|
602
|
}
|
655
|
603
|
|
656
|
|
- TIMER_STOP( timer );
|
657
|
|
-
|
658
|
604
|
return done;
|
659
|
605
|
}
|
660
|
606
|
|
661
|
607
|
|
662
|
608
|
static int
|
663
|
|
- test_sbit_cache( btimer_t* timer,
|
664
|
|
- FT_Face face,
|
|
609
|
+ test_sbit_cache( FT_Face face,
|
665
|
610
|
void* user_data )
|
666
|
611
|
{
|
667
|
612
|
FTC_SBit glyph;
|
... |
... |
@@ -671,9 +616,6 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
671
|
616
|
FT_UNUSED( face );
|
672
|
617
|
FT_UNUSED( user_data );
|
673
|
618
|
|
674
|
|
-
|
675
|
|
- TIMER_START( timer );
|
676
|
|
-
|
677
|
619
|
FOREACH( i )
|
678
|
620
|
{
|
679
|
621
|
if ( !FTC_SBitCache_Lookup( sbit_cache,
|
... |
... |
@@ -684,15 +626,12 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
684
|
626
|
done++;
|
685
|
627
|
}
|
686
|
628
|
|
687
|
|
- TIMER_STOP( timer );
|
688
|
|
-
|
689
|
629
|
return done;
|
690
|
630
|
}
|
691
|
631
|
|
692
|
632
|
|
693
|
633
|
static int
|
694
|
|
- test_cmap_iter( btimer_t* timer,
|
695
|
|
- FT_Face face,
|
|
634
|
+ test_cmap_iter( FT_Face face,
|
696
|
635
|
void* user_data )
|
697
|
636
|
{
|
698
|
637
|
FT_UInt idx;
|
... |
... |
@@ -702,23 +641,18 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
702
|
641
|
FT_UNUSED( user_data );
|
703
|
642
|
|
704
|
643
|
|
705
|
|
- TIMER_START( timer );
|
706
|
|
-
|
707
|
644
|
charcode = FT_Get_First_Char( face, &idx );
|
708
|
645
|
done = ( idx != 0 );
|
709
|
646
|
|
710
|
647
|
while ( idx != 0 )
|
711
|
648
|
charcode = FT_Get_Next_Char( face, charcode, &idx );
|
712
|
649
|
|
713
|
|
- TIMER_STOP( timer );
|
714
|
|
-
|
715
|
650
|
return done;
|
716
|
651
|
}
|
717
|
652
|
|
718
|
653
|
|
719
|
654
|
static int
|
720
|
|
- test_new_face( btimer_t* timer,
|
721
|
|
- FT_Face face,
|
|
655
|
+ test_new_face( FT_Face face,
|
722
|
656
|
void* user_data )
|
723
|
657
|
{
|
724
|
658
|
FT_Face bench_face;
|
... |
... |
@@ -727,20 +661,15 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
727
|
661
|
FT_UNUSED( user_data );
|
728
|
662
|
|
729
|
663
|
|
730
|
|
- TIMER_START( timer );
|
731
|
|
-
|
732
|
664
|
if ( !get_face( &bench_face ) )
|
733
|
665
|
FT_Done_Face( bench_face );
|
734
|
666
|
|
735
|
|
- TIMER_STOP( timer );
|
736
|
|
-
|
737
|
667
|
return 1;
|
738
|
668
|
}
|
739
|
669
|
|
740
|
670
|
|
741
|
671
|
static int
|
742
|
|
- test_new_face_and_load_glyph( btimer_t* timer,
|
743
|
|
- FT_Face face,
|
|
672
|
+ test_new_face_and_load_glyph( FT_Face face,
|
744
|
673
|
void* user_data )
|
745
|
674
|
{
|
746
|
675
|
FT_Face bench_face;
|
... |
... |
@@ -751,8 +680,6 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
751
|
680
|
FT_UNUSED( user_data );
|
752
|
681
|
|
753
|
682
|
|
754
|
|
- TIMER_START( timer );
|
755
|
|
-
|
756
|
683
|
if ( !get_face( &bench_face ) )
|
757
|
684
|
{
|
758
|
685
|
FOREACH( i )
|
... |
... |
@@ -764,8 +691,6 @@ static void benchmark(FT_Face face, btest_t* test, int max_iter, double max_time |
764
|
691
|
FT_Done_Face( bench_face );
|
765
|
692
|
}
|
766
|
693
|
|
767
|
|
- TIMER_STOP( timer );
|
768
|
|
-
|
769
|
694
|
return done;
|
770
|
695
|
}
|
771
|
696
|
|
src/tools/ftbench/src/tohtml.py
... |
... |
@@ -108,7 +108,7 @@ def generate_info_table(html_file, baseline_info, benchmark_info): |
108
|
108
|
),
|
109
|
109
|
)
|
110
|
110
|
write_to_html(html_file, "</table><br/>")
|
111
|
|
- write_to_html(html_file, "<p>* Average time for all iterations. Smaller values are better.</p>")
|
|
111
|
+ write_to_html(html_file, "<p>* Average time for single iteration. Smaller values are better.</p>")
|
112
|
112
|
write_to_html(html_file, "<p>** N count in (x | y) format is for showing baseline and benchmark N counts seperately when they differs.</p>")
|
113
|
113
|
|
114
|
114
|
|
... |
... |
@@ -181,8 +181,8 @@ def generate_total_results_table(html_file, baseline_dir, benchmark_dir): |
181
|
181
|
write_to_html(
|
182
|
182
|
html_file,
|
183
|
183
|
f'<tr><td class="col1">{test}</td><td>{n_display}</td>\
|
184
|
|
- <td class="{baseline_color}">{baseline:.0f}</td>\
|
185
|
|
- <td class="{benchmark_color}">{benchmark:.0f}</td><td>{diff:.1f}</td></tr>\n'
|
|
184
|
+ <td class="{baseline_color}">{baseline:.1f}</td>\
|
|
185
|
+ <td class="{benchmark_color}">{benchmark:.1f}</td><td>{diff:.1f}</td></tr>\n'
|
186
|
186
|
)
|
187
|
187
|
|
188
|
188
|
total_diff = ((total_baseline - total_benchmark) / total_baseline) * 100
|
... |
... |
@@ -191,7 +191,7 @@ def generate_total_results_table(html_file, baseline_dir, benchmark_dir): |
191
|
191
|
write_to_html(
|
192
|
192
|
html_file,
|
193
|
193
|
f'<tr><td class="col1">TOTAL</td><td class="col1">{total_n_display}</td>\
|
194
|
|
- <td class="col1">{total_baseline:.0f}</td><td class="col1">{total_benchmark:.0f}</td>\
|
|
194
|
+ <td class="col1">{total_baseline:.1f}</td><td class="col1">{total_benchmark:.1f}</td>\
|
195
|
195
|
<td class="col1">{total_diff:.1f}</td></tr>\n'
|
196
|
196
|
)
|
197
|
197
|
|
... |
... |
@@ -258,7 +258,7 @@ def generate_results_table(html_file, baseline_results, benchmark_results, filen |
258
|
258
|
write_to_html(
|
259
|
259
|
html_file,
|
260
|
260
|
'<tr><td class="col1">{}</td><td>{}</td>\
|
261
|
|
- <td class="lowlight">{:.0f}</td><td class="highlight">{:.0f}</td><td>{:.1f}</td></tr>\n'.format(
|
|
261
|
+ <td class="lowlight">{:.1f}</td><td class="highlight">{:.1f}</td><td>{:.1f}</td></tr>\n'.format(
|
262
|
262
|
baseline_match.group(1),
|
263
|
263
|
n,
|
264
|
264
|
baseline_value,
|
... |
... |
@@ -270,7 +270,7 @@ def generate_results_table(html_file, baseline_results, benchmark_results, filen |
270
|
270
|
write_to_html(
|
271
|
271
|
html_file,
|
272
|
272
|
'<tr><td class="col1">{}</td><td>{}</td>\
|
273
|
|
- <td class="highlight">{:.0f}</td><td class="lowlight">{:.0f}</td><td>{:.1f}</td></tr>\n'.format(
|
|
273
|
+ <td class="highlight">{:.1f}</td><td class="lowlight">{:.1f}</td><td>{:.1f}</td></tr>\n'.format(
|
274
|
274
|
baseline_match.group(1),
|
275
|
275
|
n,
|
276
|
276
|
baseline_value,
|
... |
... |
@@ -282,7 +282,7 @@ def generate_results_table(html_file, baseline_results, benchmark_results, filen |
282
|
282
|
write_to_html(
|
283
|
283
|
html_file,
|
284
|
284
|
'<tr><td class="col1">TOTAL</td><td class="col1">{}</td>\
|
285
|
|
- <td class="col1">{:.0f}</td><td class="col1">{:.0f}</td><td class="col1">{:.1f}</td></tr>\n'.format(
|
|
285
|
+ <td class="col1">{:.1f}</td><td class="col1">{:.1f}</td><td class="col1">{:.1f}</td></tr>\n'.format(
|
286
|
286
|
total_n, total_time_baseline, total_time_benchmark, (total_time_baseline - total_time_benchmark) / total_time_baseline * -100
|
287
|
287
|
),
|
288
|
288
|
)
|
|