Skip to content

Instantly share code, notes, and snippets.

@acxz
Created April 12, 2020 16:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acxz/9facb380e816dfefaf844fafdfea165d to your computer and use it in GitHub Desktop.
Save acxz/9facb380e816dfefaf844fafdfea165d to your computer and use it in GitHub Desktop.
Comparison of task_scheduler_init and task_arena
numberOfProblems = 1000000
problemSize = 4
With 1 threads:
Without memory allocation, grain size = 1, time = 0.226055
Without memory allocation, grain size = 10, time = 0.228282
Without memory allocation, grain size = 100, time = 0.22368
Without memory allocation, grain size = 1000, time = 0.223329
With memory allocation, grain size = 1, time = 0.312074
With memory allocation, grain size = 10, time = 0.312296
With memory allocation, grain size = 100, time = 0.314105
With memory allocation, grain size = 1000, time = 0.311
With 4 threads:
Without memory allocation, grain size = 1, time = 3.07355
Without memory allocation, grain size = 10, time = 3.09591
Without memory allocation, grain size = 100, time = 3.0977
Without memory allocation, grain size = 1000, time = 3.11289
With memory allocation, grain size = 1, time = 2.99229
With memory allocation, grain size = 10, time = 3.02603
With memory allocation, grain size = 100, time = 3.01861
With memory allocation, grain size = 1000, time = 3.03271
With 8 threads:
Without memory allocation, grain size = 1, time = 3.0426
Without memory allocation, grain size = 10, time = 3.01711
Without memory allocation, grain size = 100, time = 3.04969
Without memory allocation, grain size = 1000, time = 3.04553
With memory allocation, grain size = 1, time = 2.91427
With memory allocation, grain size = 10, time = 2.9693
With memory allocation, grain size = 100, time = 2.89195
With memory allocation, grain size = 1000, time = 3.18818
Summary of results:
4 threads, without allocation, grain size = 1, speedup = 0.0735484
4 threads, without allocation, grain size = 10, speedup = 0.0737366
4 threads, without allocation, grain size = 100, speedup = 0.0722085
4 threads, without allocation, grain size = 1000, speedup = 0.0717432
4 threads, with allocation, grain size = 1, speedup = 0.104293
4 threads, with allocation, grain size = 10, speedup = 0.103203
4 threads, with allocation, grain size = 100, speedup = 0.104056
4 threads, with allocation, grain size = 1000, speedup = 0.102548
8 threads, without allocation, grain size = 1, speedup = 0.0742966
8 threads, without allocation, grain size = 10, speedup = 0.0756625
8 threads, without allocation, grain size = 100, speedup = 0.0733452
8 threads, without allocation, grain size = 1000, speedup = 0.0733302
8 threads, with allocation, grain size = 1, speedup = 0.107085
8 threads, with allocation, grain size = 10, speedup = 0.105175
8 threads, with allocation, grain size = 100, speedup = 0.108614
8 threads, with allocation, grain size = 1000, speedup = 0.0975478
numberOfProblems = 1000000
problemSize = 4
With 1 threads:
Without memory allocation, grain size = 1, time = 0.221141
Without memory allocation, grain size = 10, time = 0.217688
Without memory allocation, grain size = 100, time = 0.216564
Without memory allocation, grain size = 1000, time = 0.216021
With memory allocation, grain size = 1, time = 0.308844
With memory allocation, grain size = 10, time = 0.308548
With memory allocation, grain size = 100, time = 0.309648
With memory allocation, grain size = 1000, time = 0.308654
With 4 threads:
Without memory allocation, grain size = 1, time = 3.13452
Without memory allocation, grain size = 10, time = 2.67518
Without memory allocation, grain size = 100, time = 2.11275
Without memory allocation, grain size = 1000, time = 2.07892
With memory allocation, grain size = 1, time = 2.62094
With memory allocation, grain size = 10, time = 2.58447
With memory allocation, grain size = 100, time = 2.60182
With memory allocation, grain size = 1000, time = 2.68468
With 8 threads:
Without memory allocation, grain size = 1, time = 2.49588
Without memory allocation, grain size = 10, time = 2.42528
Without memory allocation, grain size = 100, time = 2.48735
Without memory allocation, grain size = 1000, time = 2.47003
With memory allocation, grain size = 1, time = 2.66764
With memory allocation, grain size = 10, time = 2.62381
With memory allocation, grain size = 100, time = 2.63175
With memory allocation, grain size = 1000, time = 2.79184
Summary of results:
4 threads, without allocation, grain size = 1, speedup = 0.0705503
4 threads, without allocation, grain size = 10, speedup = 0.0813732
4 threads, without allocation, grain size = 100, speedup = 0.102504
4 threads, without allocation, grain size = 1000, speedup = 0.10391
4 threads, with allocation, grain size = 1, speedup = 0.117837
4 threads, with allocation, grain size = 10, speedup = 0.119385
4 threads, with allocation, grain size = 100, speedup = 0.119012
4 threads, with allocation, grain size = 1000, speedup = 0.114969
8 threads, without allocation, grain size = 1, speedup = 0.0886026
8 threads, without allocation, grain size = 10, speedup = 0.089758
8 threads, without allocation, grain size = 100, speedup = 0.0870664
8 threads, without allocation, grain size = 1000, speedup = 0.087457
8 threads, with allocation, grain size = 1, speedup = 0.115774
8 threads, with allocation, grain size = 10, speedup = 0.117595
8 threads, with allocation, grain size = 100, speedup = 0.117659
8 threads, with allocation, grain size = 1000, speedup = 0.110556
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment