HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Evaluate and Execute speeds.

07-10-2008, 04:27 PM#1
cohadar
Does anyone have a time measurement of:
(TriggerEvaluate on an empty Condition) / (TriggerExecute on an empty Action)

Collapse JASS:
//===========================================================================
private function Actions takes nothing returns nothing
endfunction

//===========================================================================
private function Conditions takes nothing returns boolean
    return false
endfunction
07-10-2008, 05:12 PM#2
Switch33
I think vex said TriggerExecute was faster, i don't know the statistics though.
Why does it matter anyways when they both do completely different things?
07-10-2008, 05:23 PM#3
chobibo
Quote:
Why does it matter anyways when they both do completely different things?
He already knows it's faster, he wants to know how fast. Maybe for some system he made, he wouldn't ask if it was unimportant.

@cohadar: Isn't there a StopTimer function people are using to measure function call speeds, I think Strilanc has one, the one he used to measure his DUI.
07-10-2008, 05:48 PM#4
Vexorian
I had a benchmark with Evaluate Execute and ExecuteFunc, but I can't find it, tried google and all.
07-10-2008, 06:22 PM#5
cohadar
Quote:
Originally Posted by Vexorian
I had a benchmark with Evaluate Execute and ExecuteFunc, but I can't find it, tried google and all.

Please (someone) make benchmark again, I cannot use grimoire japi it always crashes my game.

EDIT:
And by the way TriggerEvaluate is faster I just want to know how much faster.
07-10-2008, 06:28 PM#6
Here-b-Trollz
If you write it up and post it here, I'll run it.
07-10-2008, 06:30 PM#7
Alexander244
Expand JASS:

Evaluate Output (Average = 13.93731)

13.971
13.982
13.892
14.000
13.998
14.015
13.905
13.807
14.044
13.967
14.016
13.790
14.068
13.951
14.706
14.183
14.203
14.165
14.425
14.128
14.089
13.918
13.725
14.563
13.885
14.325
14.292
14.326
14.324
13.783
13.870
13.793
14.231
14.411
14.231
14.222
14.095
13.891
13.983
13.777
13.949
13.919
14.098
13.821
13.844
13.901
13.744
13.673
13.707
13.740
13.851
13.726
13.800
13.738
13.910
13.778
13.674
14.177
13.846
13.743
13.913
13.783
13.941
14.152
13.905
13.739
13.890
13.870
13.874
13.731
13.774
13.919
13.805
13.943
13.847
14.003
13.832
13.844
13.725
13.863
14.128
13.926
13.712
13.606
13.951
13.838
14.010
13.799
13.770
13.827
13.799
13.732
13.830
14.018
13.908
13.839
13.869
13.826
13.993
13.740
13.870
14.070
13.983
14.117
13.731
13.810
13.648
14.013
14.007
14.198
14.010
13.998
13.858
14.227
13.746
13.934
13.846
13.822
13.788
14.047
14.170
13.877
13.874
14.135
14.041
14.002
13.964
14.062
13.958
13.974
13.937
14.174
14.396
14.086
13.950
14.049
13.963
14.058
13.904
14.477
14.021
14.156
13.898
13.804
13.707
13.775
13.953
13.740
13.809
13.788
13.797
13.790
13.912
13.904
14.023
13.748
13.741
13.797
14.166
14.232
13.868
13.910
14.014
13.891
13.999
13.998
13.992
13.786
13.832
13.804
14.024
13.785
13.788
14.066
13.966
13.999
13.784
13.726
14.121
13.767
13.851
13.948
14.071
13.930
13.757
13.919
13.995
13.977
13.786
13.768
13.807
13.848
14.022
13.792
14.115
13.824
13.731
13.764
13.825
14.014


Execute Output (Average = 16.23961)

17.794
16.147
16.073
16.240
16.246
16.230
16.104
16.031
15.741
16.362
16.100
16.053
16.255
16.365
16.135
16.260
16.254
16.371
16.130
16.019
16.152
16.076
16.234
15.845
16.155
16.343
16.223
16.077
16.320
16.191
15.954
16.197
16.157
16.250
16.098
16.226
16.272
16.217
16.373
16.391
16.156
16.055
15.788
16.219
16.238
16.307
16.152
16.022
16.220
16.281
16.219
16.252
16.567
16.196
16.156
16.263
16.300
16.427
16.336
16.140
16.199
16.350
16.215
16.357
16.450
16.342
16.335
16.313
16.023
16.331
15.924
16.278
16.157
16.289
16.092
16.336
16.118
16.351
15.956
16.107
16.145
16.212
16.072
15.999
16.389
16.099
16.445
15.978
16.136
16.581
16.320
16.448
16.559
16.511
16.431
16.157
16.282
16.519
16.475
16.286
16.579
16.294
15.978
16.162
16.110
16.055
16.108
16.115
16.222
16.013
16.225
16.347
16.243
16.262
16.447
16.299
15.987
15.931
16.090
16.246
17.009
16.268
15.970
16.490
16.259
16.572
16.493
16.369
16.233
16.310
16.710
16.619
16.246
16.246
16.172
16.396
16.189
16.302
16.108
16.216
16.022
16.341
16.095
16.256
16.140
16.266
16.271
16.438
16.253
16.393
16.302
15.941
16.164
16.406
16.285
16.091
16.401
16.455
16.372
16.346
16.286
16.271
16.230
16.034
16.236
16.042
16.202
15.980
16.123
16.360
16.126
16.737
15.867
16.269
16.206
16.266
16.151
16.207
16.184
16.342
16.158
16.324
16.222
16.204
16.162
16.124
16.118
16.277
16.244
15.950
16.155
16.375
16.214
16.236
16.295
16.336
16.064
16.185
16.277
16.233


ExecuteFunc Output (Average = 17.08653)

17.609
16.989
16.934
17.099
16.801
17.313
17.115
17.222
17.251
17.035
17.02
17.031
16.871
16.897
16.868
17.24
17.1
17.13
16.941
16.955
17.283
16.937
17.135
17.041
16.858
17.251
16.932
17.08
17.111
17.02
17.042
17.391
17.152
17.061
16.904
17.3
16.947
17.097
17.028
17.113
17.084
17.086
17.216
17.221
17.038
17.178
16.993
17.076
16.939
17.139
17.027
16.95
17.006
17.197
17.23
17.076
17.083
16.967
17.157
17.295
17.089
17.371
16.886
17.329
16.898
17.274
17.225
17.404
17.342
17.394
17.125
17.259
16.997
17.197
17.051
17.252
17.21
17.172
16.933
16.975
16.983
17.55
17.199
17.128
17.114
17.167
17.159
17.009
17.177
17.173
17.043
17.282
17.112
17.242
16.99
16.888
17.091
17.067
17.174
16.935
17.108
17.125
16.939
17.156
16.933
17.021
17.527
16.988
16.909
17.122
17.041
16.997
17.07
17.185
17.089
17.06
17.145
16.98
16.983
17.03
16.945
17.018
16.942
17.046
16.884
17.212
16.94
17.213
16.825
17.03
16.893
17.186
17.068
16.945
16.931
16.814
16.854
17.091
17.056
17.18
16.999
17.064
16.941
17.051
16.864
16.955
17.028
17.094
17.064
17.141
16.929
17.014
17.269
17.095
16.903
17.039
16.895
17.482
17.14
16.925
17.197
17.29
17.077
16.988
17.035
17.098
17.242
17.28
17.122
16.981
17.042
17.316
17.223
17.153
17.292
17.042
17.378
17.18
17.17
17.101
16.859
17.19
17.247
17.021
17.076
17.061
17.02
17.049
17.095
17.084
16.853
17.251
16.977
16.891
16.9
17.06
17.215
17.033
16.882
17.034


Edited because: Added ExecuteFunc.
07-10-2008, 06:34 PM#8
Here-b-Trollz
Oh. One upped by Alex yet again.
07-10-2008, 06:56 PM#9
Anitarf
You should have included an empty loop in the benchmark, right now we have no idea what the relative difference between the methods is.

Also, you should put the integer i declaration before creating the stopwatch, although it probably doesn't have much effect since you loop one thousand times; besides, benchmarking an empty loop would take the i declaration into account too.
07-10-2008, 07:12 PM#10
Alexander244
Expand JASS:

.evaluate Output (Average = 14.11639196)

13.807
13.926
14.007
14.245
14.008
14.294
13.819
14.110
13.973
13.903
14.177
14.017
13.801
13.922
14.371
13.784
13.725
14.030
13.788
14.036
13.908
13.864
13.979
14.270
13.815
14.116
13.889
13.953
15.136
13.832
13.890
13.704
13.793
13.963
13.798
14.141
14.008
14.132
13.944
14.093
13.942
14.000
14.071
13.747
14.032
13.870
13.774
14.180
13.822
14.138
13.917
14.051
14.108
14.112
13.889
13.978
14.224
14.157
13.770
14.319
13.793
13.853
14.053
13.860
13.993
14.091
13.918
14.095
13.985
14.088
13.728
14.013
13.699
14.086
14.317
13.701
13.961
14.051
13.937
13.873
14.062
13.943
13.988
13.880
13.921
14.012
14.508
13.755
13.597
14.190
14.253
13.947
13.879
13.950
14.250
13.995
13.831
13.931
13.903
13.882
13.864
14.030
13.832
13.971
13.952
14.067
13.706
13.906
13.859
13.976
13.861
14.029
13.802
13.846
14.057
14.237
13.927
14.118
14.219
14.199
14.279
14.013
14.285
14.049
14.217
14.493
14.112
14.111
14.121
14.160
14.404
13.780
14.361
13.964
13.827
14.078
14.140
13.917
13.654
14.031
13.765
14.388
14.190
13.869
13.841
13.788
13.791
14.425
14.165
14.534
14.286
14.552
13.746
14.031
13.982
14.182
13.948
13.836
13.824
13.921
13.730
14.147
13.806
14.117
14.381
14.028
14.256
13.879
14.216
13.745
13.876
14.275
13.841
13.992
13.929
14.136
14.045
14.455
13.936
13.846
14.540
14.002
13.928
14.136
13.768
14.164
14.123
14.030
13.849
13.750
14.386
13.932
13.991
14.018
13.668
13.895
13.773
13.686
14.008
13.709


.execute Output (Average = 15.96396985)

17.902
16.245
16.157
16.305
16.168
16.299
16.251
16.223
16.350
16.281
16.184
16.287
16.275
16.566
16.278
16.332
15.904
16.143
16.296
16.121
16.404
15.954
16.176
16.149
16.244
16.448
16.150
16.374
16.128
16.206
16.200
16.153
16.220
16.073
16.361
16.324
16.324
16.304
15.986
16.260
16.478
16.229
16.283
16.173
15.954
16.182
16.338
16.375
16.227
16.428
16.251
16.392
16.361
16.501
16.255
16.122
16.494
16.129
16.209
16.248
16.391
16.232
16.036
16.333
16.229
16.152
16.289
16.220
16.147
16.180
16.056
16.388
16.084
16.373
16.083
16.246
16.360
16.098
16.215
16.283
16.274
16.275
16.226
16.378
16.034
16.055
16.152
16.431
16.319
16.260
16.156
16.247
16.286
16.514
16.187
16.063
16.170
16.275
16.145
16.051
15.988
16.206
16.216
16.175
15.981
16.619
16.190
16.275
16.157
16.204
16.320
15.979
15.885
16.118
16.232
16.741
16.462
16.260
16.145
16.263
16.461
16.148
16.078
16.049
16.281
16.654
15.912
16.230
16.103
15.942
16.051
16.338
16.208
16.150
16.059
16.333
16.359
16.257
16.136
16.097
16.139
16.092
15.902
16.200
16.231
16.184
16.293
16.258
16.148
16.517
16.203
16.282
16.299
16.120
16.077
16.197
16.017
15.943
16.163
16.308
16.202
16.277
16.070
16.304
16.123
16.410
16.184
16.348
15.987
16.170
16.225
16.650
16.465
16.311
16.296
16.097
16.186
16.134
16.006
16.059
16.131
16.208
16.241
16.297
16.154
16.152
16.134
16.596
16.378
16.179
16.052
16.321
16.093
16.228
16.241
16.331
15.981
16.088
16.186
16.300


TriggerEvaluate Output (Average = 10.75220603)

10.417
10.174
10.491
10.930
10.296
11.085
10.328
10.852
10.281
10.866
10.430
10.494
10.846
10.216
10.538
10.427
10.476
10.399
10.384
10.326
10.592
10.450
10.413
10.384
10.941
10.544
10.358
10.488
10.457
10.328
10.357
10.312
10.658
11.383
10.313
10.360
10.412
10.299
10.549
10.406
10.409
10.722
10.783
10.505
10.329
10.945
10.324
10.469
10.564
10.314
10.994
10.638
10.661
10.332
10.279
10.418
10.440
10.672
10.477
10.649
10.277
10.520
10.410
10.188
10.350
10.470
10.664
10.438
10.650
10.534
10.409
10.430
10.636
10.563
10.518
10.273
10.446
10.538
10.467
10.495
10.748
10.148
10.322
10.532
10.567
10.426
10.345
10.449
10.330
10.343
10.429
10.450
10.475
10.542
10.272
10.639
10.511
10.343
10.368
10.644
10.473
10.516
10.866
10.336
11.140
10.482
10.422
10.451
10.449
10.774
10.729
10.364
10.346
10.418
10.630
10.354
10.441
10.334
10.552
10.269
10.351
10.523
11.025
10.455
11.073
10.302
10.613
10.481
10.383
10.635
10.479
10.223
10.825
10.877
10.355
10.509
10.748
10.321
10.426
10.403
10.515
10.277
10.468
10.708
10.597
10.303
10.533
10.700
10.342
10.718
10.729
10.359
10.431
11.033
10.471
10.585
10.533
10.460
10.507
10.607
10.504
10.325
10.375
10.412
10.557
10.221
11.207
10.573
10.488
10.490
10.195
10.298
10.850
10.475
10.384
10.262
10.464
10.377
10.430
10.375
10.281
10.433
10.508
10.604
10.878
10.609
10.628
10.160
10.381
10.352
10.520
10.396
10.617
10.448
10.282
10.207
10.218
10.340
10.459
10.213


TriggerExecute Output (Average = 16.31647236)

16.509
16.022
16.405
16.202
16.243
16.111
16.045
16.111
16.393
16.272
15.946
16.093
16.450
16.343
16.233
15.961
16.099
16.143
16.293
16.424
16.094
16.599
15.824
16.306
16.303
16.594
16.063
16.224
16.420
16.054
16.065
16.060
16.359
16.058
16.656
16.295
16.144
16.221
15.840
16.147
16.141
15.952
16.365
16.290
16.124
15.831
16.346
16.562
16.257
16.018
16.616
16.164
16.283
16.134
16.412
15.976
16.252
16.082
16.100
16.103
16.340
16.136
15.997
15.974
16.033
16.159
16.118
15.882
16.369
15.808
16.245
16.239
16.113
16.308
16.030
16.099
16.394
16.023
16.049
16.333
16.041
16.664
16.377
16.352
16.448
16.218
16.989
16.489
16.453
16.553
16.484
16.649
16.403
16.228
16.252
16.162
16.177
16.083
16.410
16.223
16.109
16.016
16.130
16.365
16.043
16.504
16.594
16.368
16.114
16.748
16.207
16.076
16.091
16.496
16.448
16.287
16.351
16.504
16.020
16.084
15.929
16.313
16.125
16.069
16.206
16.280
16.436
16.026
15.838
16.431
16.319
16.380
16.507
16.425
16.533
16.005
16.378
16.375
16.286
16.301
16.108
16.375
16.257
16.262
15.912
16.136
16.434
16.562
16.485
16.582
16.662
16.196
16.820
16.616
16.563
16.294
16.331
16.295
16.207
16.436
16.555
16.507
16.533
16.578
16.453
16.984
16.037
16.328
16.460
16.687
16.309
16.367
16.202
16.259
16.073
16.268
16.433
16.124
16.277
16.392
15.864
16.550
16.296
16.302
16.384
16.291
16.304
16.338
15.973
16.363
16.079
16.311
16.154
16.465
16.376
16.200
16.212
16.226
16.292
16.292


ExecuteFunc Output (Average = 16.52057286)

17.850
17.142
16.898
17.287
16.968
17.720
17.189
16.953
17.000
17.165
17.116
17.265
16.969
17.307
17.038
17.744
17.093
17.217
16.923
17.189
17.173
17.196
16.919
17.278
17.111
17.559
16.935
17.337
17.110
17.232
17.171
17.040
17.155
17.184
17.272
17.251
16.797
17.123
16.967
17.150
17.065
17.193
17.030
17.213
17.079
17.198
16.939
17.416
17.154
17.321
17.054
17.246
17.213
17.165
16.964
17.171
17.167
17.241
17.333
17.290
17.180
17.282
17.003
17.265
17.182
17.281
17.065
17.180
17.202
17.048
17.013
17.190
17.095
17.281
17.016
17.172
17.229
17.239
17.254
17.216
17.471
17.191
16.907
17.466
17.006
17.138
17.149
16.876
17.371
17.152
16.988
17.066
16.888
17.435
17.006
17.066
17.151
17.101
17.341
16.824
17.115
17.200
17.095
17.266
16.941
17.448
17.132
17.051
17.176
17.094
17.079
17.271
17.119
17.127
17.040
17.433
16.813
17.115
17.054
17.046
16.985
17.312
16.987
17.196
16.949
17.267
16.964
17.189
17.026
17.168
17.080
17.669
17.370
17.253
17.160
17.136
17.279
17.261
17.085
17.588
17.175
17.642
17.246
17.406
17.301
17.237
17.245
17.489
17.224
17.245
16.960
17.139
17.014
17.266
16.972
16.881
17.215
16.858
17.080
17.460
16.968
17.328
17.047
17.329
17.067
17.208
17.290
17.358
17.266
17.373
17.236
17.283
16.924
17.302
17.047
17.360
17.109
17.204
17.421
17.478
17.196
17.192
17.032
17.248
17.114
17.551
17.648
17.437
17.159
17.489
17.451
17.305
17.262
17.317
17.115
17.448
17.050
17.400
17.093
17.539


call Output (Average = 2.417316583)

2.349
2.389
2.349
2.486
2.521
2.425
2.466
2.493
2.619
2.408
2.319
2.314
2.413
2.459
2.475
2.301
2.530
2.338
2.482
2.437
2.540
2.562
2.456
2.464
2.461
2.441
2.369
2.461
2.319
2.446
2.463
2.481
2.304
2.478
2.480
2.424
2.459
2.471
2.515
2.451
2.435
2.461
2.598
2.413
2.453
2.302
2.433
2.310
2.429
2.487
2.510
2.348
2.457
2.549
2.598
2.424
2.337
2.412
2.458
2.546
2.390
2.291
2.342
2.458
2.375
2.420
2.316
2.488
2.473
2.429
2.433
2.642
2.773
2.459
2.457
2.458
2.714
2.311
2.477
2.304
2.447
2.469
2.398
2.326
2.499
2.570
2.412
2.455
2.750
2.657
2.456
2.425
2.414
2.559
2.492
2.458
2.326
2.375
2.427
2.370
2.312
2.479
2.473
2.434
2.461
2.503
2.558
2.372
2.326
2.562
2.510
2.451
2.333
2.314
2.536
2.493
2.304
2.453
2.503
2.487
2.466
2.391
2.540
2.451
2.469
2.423
2.514
2.518
2.311
2.483
2.318
2.447
2.500
2.305
2.309
2.535
2.470
2.456
2.399
2.458
2.509
2.451
2.457
2.421
2.484
2.473
2.427
2.334
2.480
2.447
2.466
2.342
2.550
2.456
2.421
2.309
2.565
2.645
2.310
2.458
2.412
2.525
2.548
2.468
2.446
2.468
2.597
2.423
2.325
2.328
2.425
2.491
2.367
2.311
2.442
2.494
2.470
2.431
2.391
2.469
2.454
2.461
2.322
2.494
2.462
2.416
2.461
2.411
2.515
2.328
2.474
2.469
2.469
2.527
2.461
2.306
2.447
2.420
2.439
2.382


Empty Output (Average = 1.819668421)

1.895
1.815
1.808
1.783
1.891
1.887
1.813
1.791
1.814
1.823
1.818
1.830
1.800
1.793
1.814
1.833
1.846
1.831
1.823
1.778
1.826
1.802
1.910
1.737
1.827
1.830
1.864
1.816
1.792
1.819
1.807
1.816
1.856
1.775
1.783
1.808
1.801
1.797
1.874
1.864
1.804
1.819
1.767
1.872
1.807
1.822
1.747
1.802
1.803
1.817
1.812
1.778
1.811
1.829
1.812
1.792
1.896
1.827
1.779
1.831
1.770
1.888
1.767
1.799
1.812
1.830
1.803
1.815
1.804
1.836
1.814
1.841
1.811
1.784
1.808
1.828
1.813
1.766
1.843
1.777
1.803
1.827
1.840
1.789
1.813
1.817
1.806
1.827
1.812
1.826
1.873
1.775
1.782
1.874
1.860
1.888
1.730
1.830
1.801
1.850
1.885
1.768
1.800
1.814
1.786
1.797
1.765
1.817
1.805
1.803
1.800
1.768
1.868
1.807
1.805
1.809
1.829
1.853
1.815
1.778
1.773
1.908
1.813
1.828
1.788
1.831
1.813
1.826
1.867
1.978
1.812
1.826
1.825
1.951
1.813
1.827
1.811
1.816
1.813
1.829
1.768
1.878
1.813
1.819
1.801
1.873
1.870
1.820
1.888
1.841
1.873
1.792
1.813
1.792
1.859
1.819
1.813
1.822
1.898
1.764
1.812
1.827
1.839
1.912
1.812
1.825
1.810
1.907
1.811
1.819
1.812
1.818
1.801
1.842
1.830
1.790
1.800
1.833
1.814
1.833
1.817
1.824
1.814
1.789
1.802
1.736
1.808
1.836
1.827
1.975
1.834
1.784
1.814
1.833
1.770
1.758
1.775
1.801
1.819
1.809



Tested:Rough time ratio:
.evaluate12.3
.execute14.1
TriggerEvaluate8.9
TriggerExecute14.5
ExecuteFunc14.7
call0.6

Even with 200*1000 executions there seems to be a fair amount of error. Will need to test multiple times for more accurate results.
07-10-2008, 07:13 PM#11
Vexorian
.evaluate() and .execute() are different to TriggerExecute and TriggerEvaluate.
07-10-2008, 07:46 PM#12
Alexander244
I can't read.

...OK, updated.
07-10-2008, 10:23 PM#13
cohadar
Someone please give some rep to Alexander244 in my name, I can't atm.

And the results are wow, I had no idea (evaluate/execute) ration is so close to 1.

I was expecting execute to be like 5 times heavier considering that it needs to create new thread and all....

Maybe jass virtual machine threads don't work like C++ threads,
maybe it is a stupid as: set preemptive = true hahaha


EDIT:
Hay alexander how about you test a boolexpr that points to a function.
Something like if boolexpr_var then endif
07-11-2008, 12:08 AM#14
Vexorian
Quote:
And the results are wow, I had no idea (evaluate/execute) ration is so close to 1.
I got around a 1/3 ratio with my other test, i'll look for the other one to see the differences.

Quote:
Maybe jass virtual machine threads don't work like C++ threads
dude, they aren't even threads. There is only one Jass thread.
07-11-2008, 12:43 AM#15
cohadar
Quote:
Originally Posted by Vexorian
dude, they aren't even threads. There is only one Jass thread.

They are preemptive == they are threads. How they are implemented is irrelevant.

I sure hope to see some more test results since Vex seems to disagree with current ones.