Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move instantiation to separate file #518

Merged
merged 4 commits into from
Sep 9, 2020
Merged

Move instantiation to separate file #518

merged 4 commits into from
Sep 9, 2020

Conversation

gumb0
Copy link
Collaborator

@gumb0 gumb0 commented Sep 3, 2020

This tries to keep git blame results clear, therefore needs a merge commit for that.

Suppressing clang-tidy false positive warning was added first in aba1d78, then was removed in #314, now it looks to be needed again.

@gumb0 gumb0 force-pushed the instantiate-hpp branch 3 times, most recently from b05a2aa to 03d4343 Compare September 4, 2020 10:11
@codecov
Copy link

codecov bot commented Sep 4, 2020

Codecov Report

Merging #518 into master will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #518   +/-   ##
=======================================
  Coverage   98.73%   98.73%           
=======================================
  Files          54       56    +2     
  Lines        8695     8695           
=======================================
  Hits         8585     8585           
  Misses        110      110           

@gumb0
Copy link
Collaborator Author

gumb0 commented Sep 4, 2020

Weird, that I can't reproduce clang-tidy warning locally, using clang 10.0.1...

@gumb0 gumb0 marked this pull request as ready for review September 4, 2020 11:59
@gumb0 gumb0 requested review from axic and chfast September 4, 2020 13:13
Copy link
Collaborator

@chfast chfast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are there any changes in the moved code?

// SPDX-License-Identifier: Apache-2.0

#include "instantiate.hpp"
#include "execute.hpp"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? Looks like cyclic dependency.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are calls to execute when initializing table elements etc.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh. Can you leave a comment perhaps?

@gumb0
Copy link
Collaborator Author

gumb0 commented Sep 4, 2020

Are there any changes in the moved code?

No. I only tried to remove unnecessary #includes

@gumb0
Copy link
Collaborator Author

gumb0 commented Sep 4, 2020

Are there any changes in the moved code?

No. I only tried to remove unnecessary #includes

The only change is suppressing clang-tidye in the last commit.

Copy link
Collaborator

@chfast chfast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@@ -685,142 +469,6 @@ std::optional<uint32_t> find_export(const Module& module, ExternalKind kind, std

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the find_export helper above used? I always thought it is used by instantiation, but it is used in the execution loop?!

Copy link
Collaborator Author

@gumb0 gumb0 Sep 4, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's used only in find_exported_* API, which stays in execute.cpp for now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those operate on the instance, shouldn't they belong into instantiate.cpp?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Logically they are neither instantiation nor execution, I would put them into separate header, maybe export.hpp, or api.hpp because we have api_test.cpp for them. What do you think?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is hard for me to discriminate what they are for (not my area of knowledge) so "kinda whatever". Can be also "module.hpp/cpp" if that make sense (I know this is non-functional name, but this can be found in other projects).

But I really want to have only execute() function in execute.cpp what makes execution optimizations easier to conduct. In the end we can think about it as: extracting execute() from the instatiate.cpp file...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was getting a bit too complicated for one PR, will keep them in instantiate.

@chfast
Copy link
Collaborator

chfast commented Sep 4, 2020

This actually makes execution significant faster (GCC10, no-LTO):

fizzy/parse/blake2b_mean                                          -0.0055         -0.0055            23            23            23            23
fizzy/instantiate/blake2b_mean                                    -0.0013         -0.0013            28            27            28            27
fizzy/execute/blake2b/512_bytes_rounds_1_mean                     -0.1369         -0.1369            87            75            87            75
fizzy/execute/blake2b/512_bytes_rounds_16_mean                    -0.1377         -0.1377          1312          1131          1312          1131
fizzy/parse/ecpairing_mean                                        +0.0004         +0.0004          1335          1335          1335          1335
fizzy/instantiate/ecpairing_mean                                  +0.0022         +0.0023          1400          1403          1400          1403
fizzy/execute/ecpairing/onepoint_mean                             -0.1425         -0.1425        443206        380033        443209        380038
fizzy/parse/keccak256_mean                                        +0.0032         +0.0032            42            42            42            42
fizzy/instantiate/keccak256_mean                                  -0.0038         -0.0038            47            47            47            47
fizzy/execute/keccak256/512_bytes_rounds_1_mean                   -0.0828         -0.0828           102            94           102            94
fizzy/execute/keccak256/512_bytes_rounds_16_mean                  -0.0794         -0.0794          1493          1375          1493          1375
fizzy/parse/memset_mean                                           -0.0182         -0.0182             6             6             6             6
fizzy/instantiate/memset_mean                                     +0.0001         +0.0001            10            10            10            10
fizzy/execute/memset/256_bytes_mean                               -0.1218         -0.1218             7             6             7             6
fizzy/execute/memset/60000_bytes_mean                             -0.1245         -0.1245          1583          1386          1583          1386
fizzy/parse/mul256_opt0_mean                                      -0.0044         -0.0044             8             8             8             8
fizzy/instantiate/mul256_opt0_mean                                -0.0080         -0.0080            12            12            12            12
fizzy/execute/mul256_opt0/input0_mean                             -0.0628         -0.0627            27            25            27            25
fizzy/execute/mul256_opt0/input1_mean                             -0.0778         -0.0778            27            25            27            25
fizzy/parse/ramanujan_pi_mean                                     -0.0023         -0.0023            24            24            24            24
fizzy/instantiate/ramanujan_pi_mean                               -0.0067         -0.0066            29            28            29            28
fizzy/execute/ramanujan_pi/33_runs_mean                           -0.1861         -0.1861           135           110           135           110
fizzy/parse/sha1_mean                                             -0.0114         -0.0114            38            38            38            38
fizzy/instantiate/sha1_mean                                       -0.0089         -0.0089            43            42            43            42
fizzy/execute/sha1/512_bytes_rounds_1_mean                        -0.0984         -0.0984            93            84            93            84
fizzy/execute/sha1/512_bytes_rounds_16_mean                       -0.0944         -0.0944          1287          1166          1287          1166
fizzy/parse/sha256_mean                                           -0.0019         -0.0019            63            63            63            63
fizzy/instantiate/sha256_mean                                     -0.0026         -0.0026            69            69            69            69
fizzy/execute/sha256/512_bytes_rounds_1_mean                      -0.1375         -0.1375           100            86           100            86
fizzy/execute/sha256/512_bytes_rounds_16_mean                     -0.1407         -0.1407          1386          1191          1386          1191
fizzy/parse/taylor_pi_mean                                        -0.0297         -0.0297             3             2             3             2
fizzy/instantiate/taylor_pi_mean                                  -0.0123         -0.0123             7             7             7             7
fizzy/execute/taylor_pi/pi_1000000_runs_mean                      +0.1246         +0.1246         40998         46105         40999         46106
fizzy/parse/micro/eli_interpreter_mean                            -0.0193         -0.0193             4             4             4             4
fizzy/instantiate/micro/eli_interpreter_mean                      -0.0033         -0.0033             8             8             8             8
fizzy/execute/micro/eli_interpreter/halt_mean                     -0.0750         -0.0749             0             0             0             0
fizzy/execute/micro/eli_interpreter/exec105_mean                  -0.1065         -0.1065             5             4             5             4
fizzy/parse/micro/factorial_mean                                  -0.0576         -0.0576             1             1             1             1
fizzy/instantiate/micro/factorial_mean                            -0.0019         -0.0019             1             1             1             1
fizzy/execute/micro/factorial/10_mean                             -0.0764         -0.0764             0             0             0             0
fizzy/execute/micro/factorial/20_mean                             -0.0611         -0.0611             1             1             1             1
fizzy/parse/micro/fibonacci_mean                                  -0.0351         -0.0351             1             1             1             1
fizzy/instantiate/micro/fibonacci_mean                            +0.0017         +0.0017             2             2             2             2
fizzy/execute/micro/fibonacci/24_mean                             -0.0647         -0.0647          7600          7108          7600          7109
fizzy/parse/micro/host_adler32_mean                               -0.0500         -0.0500             2             2             2             2
fizzy/instantiate/micro/host_adler32_mean                         +0.0060         +0.0060             4             4             4             4
fizzy/execute/micro/host_adler32/1_mean                           -0.0344         -0.0344             0             0             0             0
fizzy/execute/micro/host_adler32/100_mean                         +0.0010         +0.0010             3             3             3             3
fizzy/execute/micro/host_adler32/1000_mean                        -0.0022         -0.0022            29            29            29            29
fizzy/parse/micro/spinner_mean                                    -0.0027         -0.0027             1             1             1             1
fizzy/instantiate/micro/spinner_mean                              +0.0134         +0.0134             1             1             1             1
fizzy/execute/micro/spinner/1_mean                                -0.0349         -0.0349             0             0             0             0
fizzy/execute/micro/spinner/1000_mean                             -0.0767         -0.0767            10             9            10             9

Copy link
Collaborator

@chfast chfast left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are some function after execute() that also should be moved to instantiate.cpp

@chfast
Copy link
Collaborator

chfast commented Sep 4, 2020

But no much change for LTO builds:

fizzy/parse/blake2b_mean                                          +0.0044         +0.0044            23            23            23            23
fizzy/instantiate/blake2b_mean                                    +0.0054         +0.0053            28            28            28            28
fizzy/execute/blake2b/512_bytes_rounds_1_mean                     +0.0148         +0.0148            85            86            85            86
fizzy/execute/blake2b/512_bytes_rounds_16_mean                    +0.0165         +0.0165          1279          1300          1279          1300
fizzy/parse/ecpairing_mean                                        +0.0047         +0.0047          1348          1354          1348          1354
fizzy/instantiate/ecpairing_mean                                  -0.0041         -0.0041          1428          1422          1428          1422
fizzy/execute/ecpairing/onepoint_mean                             +0.0408         +0.0408        420841        438000        420847        438005
fizzy/parse/keccak256_mean                                        +0.0079         +0.0079            42            42            42            42
fizzy/instantiate/keccak256_mean                                  +0.0132         +0.0132            47            48            47            48
fizzy/execute/keccak256/512_bytes_rounds_1_mean                   -0.0122         -0.0122           108           107           108           107
fizzy/execute/keccak256/512_bytes_rounds_16_mean                  -0.0009         -0.0009          1559          1558          1559          1558
fizzy/parse/memset_mean                                           +0.0048         +0.0048             6             6             6             6
fizzy/instantiate/memset_mean                                     +0.0174         +0.0174            10            10            10            10
fizzy/execute/memset/256_bytes_mean                               +0.0328         +0.0328             7             7             7             7
fizzy/execute/memset/60000_bytes_mean                             +0.0315         +0.0315          1543          1591          1543          1591
fizzy/parse/mul256_opt0_mean                                      +0.0036         +0.0036             8             8             8             8
fizzy/instantiate/mul256_opt0_mean                                -0.0043         -0.0043            12            12            12            12
fizzy/execute/mul256_opt0/input0_mean                             +0.0853         +0.0853            26            28            26            28
fizzy/execute/mul256_opt0/input1_mean                             +0.0788         +0.0788            26            28            26            28
fizzy/parse/ramanujan_pi_mean                                     -0.0003         -0.0003            23            23            23            23
fizzy/instantiate/ramanujan_pi_mean                               +0.0039         +0.0039            28            28            28            28
fizzy/execute/ramanujan_pi/33_runs_mean                           +0.0299         +0.0299           127           130           127           130
fizzy/parse/sha1_mean                                             +0.0049         +0.0049            38            38            38            38
fizzy/instantiate/sha1_mean                                       +0.0089         +0.0089            43            43            43            43
fizzy/execute/sha1/512_bytes_rounds_1_mean                        +0.0477         +0.0477            90            94            90            94
fizzy/execute/sha1/512_bytes_rounds_16_mean                       +0.0493         +0.0493          1252          1314          1252          1314
fizzy/parse/sha256_mean                                           +0.0010         +0.0010            64            64            64            64
fizzy/instantiate/sha256_mean                                     -0.0061         -0.0061            70            69            70            69
fizzy/execute/sha256/512_bytes_rounds_1_mean                      +0.0219         +0.0219            93            95            93            95
fizzy/execute/sha256/512_bytes_rounds_16_mean                     +0.0106         +0.0106          1292          1306          1292          1306
fizzy/parse/taylor_pi_mean                                        -0.0019         -0.0019             2             2             2             2
fizzy/instantiate/taylor_pi_mean                                  +0.0144         +0.0144             7             7             7             7
fizzy/execute/taylor_pi/pi_1000000_runs_mean                      +0.0318         +0.0318         41401         42719         41402         42719
fizzy/parse/micro/eli_interpreter_mean                            +0.0034         +0.0034             4             4             4             4
fizzy/instantiate/micro/eli_interpreter_mean                      +0.0109         +0.0109             8             8             8             8
fizzy/execute/micro/eli_interpreter/halt_mean                     -0.0103         -0.0103             0             0             0             0
fizzy/execute/micro/eli_interpreter/exec105_mean                  -0.0128         -0.0128             5             5             5             5
fizzy/parse/micro/factorial_mean                                  -0.0064         -0.0064             1             1             1             1
fizzy/instantiate/micro/factorial_mean                            +0.0347         +0.0347             1             1             1             1
fizzy/execute/micro/factorial/10_mean                             -0.0006         -0.0006             0             0             0             0
fizzy/execute/micro/factorial/20_mean                             +0.0029         +0.0029             1             1             1             1
fizzy/parse/micro/fibonacci_mean                                  +0.0062         +0.0062             1             1             1             1
fizzy/instantiate/micro/fibonacci_mean                            +0.0100         +0.0100             2             2             2             2
fizzy/execute/micro/fibonacci/24_mean                             -0.0206         -0.0206          7785          7624          7785          7624
fizzy/parse/micro/host_adler32_mean                               -0.0047         -0.0047             2             2             2             2
fizzy/instantiate/micro/host_adler32_mean                         -0.0040         -0.0040             4             4             4             4
fizzy/execute/micro/host_adler32/1_mean                           +0.0238         +0.0238             0             0             0             0
fizzy/execute/micro/host_adler32/100_mean                         +0.0202         +0.0202             3             3             3             3
fizzy/execute/micro/host_adler32/1000_mean                        +0.0245         +0.0245            29            30            29            30
fizzy/parse/micro/spinner_mean                                    -0.0194         -0.0194             1             1             1             1
fizzy/instantiate/micro/spinner_mean                              +0.0248         +0.0248             1             1             1             1
fizzy/execute/micro/spinner/1_mean                                -0.0001         -0.0001             0             0             0             0
fizzy/execute/micro/spinner/1000_mean                             +0.0258         +0.0258            10            11            10            11

@gumb0 gumb0 force-pushed the instantiate-hpp branch 2 times, most recently from cd55a7d to eb6b556 Compare September 7, 2020 11:07
@gumb0
Copy link
Collaborator Author

gumb0 commented Sep 7, 2020

No clang-tidy warning again.

@gumb0 gumb0 requested review from axic and chfast September 7, 2020 11:19
@chfast
Copy link
Collaborator

chfast commented Sep 7, 2020

Now some benchmarks gets slower.

LTO

fizzy/execute/blake2b/512_bytes_rounds_1_mean                     +0.0286         +0.0286            83            86            83            86
fizzy/execute/blake2b/512_bytes_rounds_16_mean                    +0.0293         +0.0293          1262          1299          1262          1299
fizzy/execute/ecpairing/onepoint_mean                             -0.0076         -0.0076        440970        437618        440975        437623
fizzy/execute/keccak256/512_bytes_rounds_1_mean                   +0.0104         +0.0103           103           104           103           104
fizzy/execute/keccak256/512_bytes_rounds_16_mean                  +0.0052         +0.0052          1514          1522          1514          1522
fizzy/execute/memset/256_bytes_mean                               +0.0301         +0.0301             7             7             7             7
fizzy/execute/memset/60000_bytes_mean                             +0.0325         +0.0325          1543          1593          1543          1593
fizzy/execute/mul256_opt0/input0_mean                             +0.0762         +0.0762            26            28            26            28
fizzy/execute/mul256_opt0/input1_mean                             +0.0879         +0.0879            26            28            26            28
fizzy/execute/ramanujan_pi/33_runs_mean                           +0.0349         +0.0349           128           132           128           132
fizzy/execute/sha1/512_bytes_rounds_1_mean                        +0.0470         +0.0470            90            95            90            95
fizzy/execute/sha1/512_bytes_rounds_16_mean                       +0.0472         +0.0472          1258          1317          1258          1317
fizzy/execute/sha256/512_bytes_rounds_1_mean                      +0.0624         +0.0624            92            98            92            98
fizzy/execute/sha256/512_bytes_rounds_16_mean                     +0.0698         +0.0698          1262          1350          1262          1350
fizzy/execute/taylor_pi/pi_1000000_runs_mean                      +0.0317         +0.0317         41300         42609         41300         42610
fizzy/execute/micro/eli_interpreter/halt_mean                     -0.0020         -0.0021             0             0             0             0
fizzy/execute/micro/eli_interpreter/exec105_mean                  -0.0141         -0.0141             5             5             5             5
fizzy/execute/micro/factorial/10_mean                             +0.0138         +0.0138             0             0             0             0
fizzy/execute/micro/factorial/20_mean                             -0.0067         -0.0067             1             1             1             1
fizzy/execute/micro/fibonacci/24_mean                             +0.0204         +0.0204          7894          8055          7894          8055
fizzy/execute/micro/host_adler32/1_mean                           -0.0031         -0.0031             0             0             0             0
fizzy/execute/micro/host_adler32/100_mean                         +0.0289         +0.0289             3             3             3             3
fizzy/execute/micro/host_adler32/1000_mean                        +0.0270         +0.0270            29            30            29            30
fizzy/execute/micro/spinner/1_mean                                -0.0083         -0.0083             0             0             0             0
fizzy/execute/micro/spinner/1000_mean                             +0.0495         +0.0495            10            11            10            11

non-LTO

fizzy/execute/blake2b/512_bytes_rounds_1_mean                     +0.0140         +0.0140            75            76            75            76
fizzy/execute/blake2b/512_bytes_rounds_16_mean                    +0.0153         +0.0153          1134          1152          1134          1152
fizzy/execute/ecpairing/onepoint_mean                             +0.0265         +0.0265        384210        394410        384213        394413
fizzy/execute/keccak256/512_bytes_rounds_1_mean                   -0.0024         -0.0024            94            94            94            94
fizzy/execute/keccak256/512_bytes_rounds_16_mean                  -0.0054         -0.0054          1378          1371          1378          1371
fizzy/execute/memset/256_bytes_mean                               -0.0011         -0.0011             6             6             6             6
fizzy/execute/memset/60000_bytes_mean                             -0.0022         -0.0022          1389          1386          1389          1386
fizzy/execute/mul256_opt0/input0_mean                             -0.0038         -0.0038            25            24            25            24
fizzy/execute/mul256_opt0/input1_mean                             -0.0029         -0.0029            25            25            25            25
fizzy/execute/ramanujan_pi/33_runs_mean                           +0.5962         +0.5962           115           184           115           184
fizzy/execute/sha1/512_bytes_rounds_1_mean                        +0.0125         +0.0125            84            85            84            85
fizzy/execute/sha1/512_bytes_rounds_16_mean                       +0.0090         +0.0090          1172          1182          1172          1182
fizzy/execute/sha256/512_bytes_rounds_1_mean                      +0.0150         +0.0150            86            87            86            87
fizzy/execute/sha256/512_bytes_rounds_16_mean                     +0.0125         +0.0125          1182          1197          1182          1197
fizzy/execute/taylor_pi/pi_1000000_runs_mean                      -0.0149         -0.0149         40761         40153         40761         40153
fizzy/execute/micro/eli_interpreter/halt_mean                     -0.0178         -0.0178             0             0             0             0
fizzy/execute/micro/eli_interpreter/exec105_mean                  +0.0031         +0.0031             4             4             4             4
fizzy/execute/micro/factorial/10_mean                             +0.0093         +0.0093             0             0             0             0
fizzy/execute/micro/factorial/20_mean                             +0.0081         +0.0081             1             1             1             1
fizzy/execute/micro/fibonacci/24_mean                             +0.0125         +0.0125          7226          7316          7226          7316
fizzy/execute/micro/host_adler32/1_mean                           +0.0156         +0.0156             0             0             0             0
fizzy/execute/micro/host_adler32/100_mean                         +0.0010         +0.0010             3             3             3             3
fizzy/execute/micro/host_adler32/1000_mean                        +0.0146         +0.0146            29            30            29            30
fizzy/execute/micro/spinner/1_mean                                -0.0030         -0.0030             0             0             0             0
fizzy/execute/micro/spinner/1000_mean                             -0.0013         -0.0013             9             9             9             9

@gumb0
Copy link
Collaborator Author

gumb0 commented Sep 7, 2020

My results are mostly within 1-2% change

GCC10, LTO

fizzy/parse/blake2b_mean                                          +0.0112         +0.0111            59            60            59            60
fizzy/instantiate/blake2b_mean                                    +0.0067         +0.0067            68            68            68            68
fizzy/execute/blake2b/512_bytes_rounds_1_mean                     +0.0110         +0.0110           216           218           216           218
fizzy/execute/blake2b/512_bytes_rounds_16_mean                    +0.0147         +0.0147          3263          3311          3262          3310
fizzy/parse/ecpairing_mean                                        +0.0023         +0.0023          3495          3503          3495          3503
fizzy/instantiate/ecpairing_mean                                  +0.0009         +0.0009          3621          3625          3621          3624
fizzy/execute/ecpairing/onepoint_mean                             -0.0221         -0.0219       1096486       1072231       1096222       1072195
fizzy/parse/keccak256_mean                                        -0.0011         -0.0011           111           110           111           110
fizzy/instantiate/keccak256_mean                                  -0.0059         -0.0059           120           120           120           120
fizzy/execute/keccak256/512_bytes_rounds_1_mean                   -0.0001         -0.0001           260           260           260           260
fizzy/execute/keccak256/512_bytes_rounds_16_mean                  -0.0104         -0.0104          3818          3778          3817          3778
fizzy/parse/memset_mean                                           +0.0007         +0.0007            15            15            15            15
fizzy/instantiate/memset_mean                                     +0.0111         +0.0112            22            22            22            22
fizzy/execute/memset/256_bytes_mean                               -0.0006         -0.0005            18            18            18            18
fizzy/execute/memset/60000_bytes_mean                             -0.0002         -0.0002          4034          4033          4034          4033
fizzy/parse/mul256_opt0_mean                                      -0.0184         -0.0179            20            19            20            19
fizzy/instantiate/mul256_opt0_mean                                -0.0334         -0.0334            27            26            27            26
fizzy/execute/mul256_opt0/input0_mean                             -0.0285         -0.0285            67            65            67            65
fizzy/execute/mul256_opt0/input1_mean                             -0.0074         -0.0074            66            65            66            65
fizzy/parse/ramanujan_pi_mean                                     +0.0091         +0.0091            63            64            63            64
fizzy/instantiate/ramanujan_pi_mean                               +0.0059         +0.0060            72            72            72            72
fizzy/execute/ramanujan_pi/33_runs_mean                           +0.0154         +0.0154           333           338           333           338
fizzy/parse/sha1_mean                                             +0.0071         +0.0071           100           101           100           101
fizzy/instantiate/sha1_mean                                       +0.0010         +0.0011           109           109           109           109
fizzy/execute/sha1/512_bytes_rounds_1_mean                        -0.0116         -0.0116           235           233           235           233
fizzy/execute/sha1/512_bytes_rounds_16_mean                       +0.0061         +0.0061          3218          3238          3218          3237
fizzy/parse/sha256_mean                                           +0.0056         +0.0056           165           166           165           166
fizzy/instantiate/sha256_mean                                     +0.0026         +0.0026           175           176           175           176
fizzy/execute/sha256/512_bytes_rounds_1_mean                      -0.0018         -0.0018           238           237           238           237
fizzy/execute/sha256/512_bytes_rounds_16_mean                     -0.0082         -0.0082          3273          3246          3272          3246
fizzy/parse/taylor_pi_mean                                        -0.0048         -0.0048             6             6             6             6
fizzy/instantiate/taylor_pi_mean                                  +0.0260         +0.0260            13            13            13            13
fizzy/execute/taylor_pi/pi_1000000_runs_mean                      -0.0006         -0.0006        101067        101002        101062        100998
fizzy/parse/micro/eli_interpreter_mean                            +0.0062         +0.0062            10            10            10            10
fizzy/instantiate/micro/eli_interpreter_mean                      +0.0159         +0.0159            17            17            17            17
fizzy/execute/micro/eli_interpreter/halt_mean                     -0.0002         -0.0002             0             0             0             0
fizzy/execute/micro/eli_interpreter/exec105_mean                  +0.0017         +0.0017            12            12            12            12
fizzy/parse/micro/factorial_mean                                  -0.0235         -0.0235             2             2             2             2
fizzy/instantiate/micro/factorial_mean                            -0.0229         -0.0228             3             3             3             3
fizzy/execute/micro/factorial/10_mean                             -0.0079         -0.0078             1             1             1             1
fizzy/execute/micro/factorial/20_mean                             -0.0036         -0.0035             2             2             2             2
fizzy/parse/micro/fibonacci_mean                                  +0.0102         +0.0102             3             3             3             3
fizzy/instantiate/micro/fibonacci_mean                            +0.0074         +0.0074             4             4             4             4
fizzy/execute/micro/fibonacci/24_mean                             -0.0010         -0.0010         17935         17916         17934         17916
fizzy/parse/micro/host_adler32_mean                               +0.0136         +0.0136             4             4             4             4
fizzy/instantiate/micro/host_adler32_mean                         +0.0113         +0.0113             9             9             9             9
fizzy/execute/micro/host_adler32/1_mean                           +0.0058         +0.0058             0             0             0             0
fizzy/execute/micro/host_adler32/100_mean                         -0.0014         -0.0014             8             8             8             8
fizzy/execute/micro/host_adler32/1000_mean                        -0.0030         -0.0030            77            76            77            76
fizzy/parse/micro/spinner_mean                                    -0.0030         -0.0030             2             2             2             2
fizzy/instantiate/micro/spinner_mean                              -0.0084         -0.0084             3             3             3             3
fizzy/execute/micro/spinner/1_mean                                -0.0033         -0.0033             0             0             0             0
fizzy/execute/micro/spinner/1000_mean                             -0.0019         -0.0018            28            28            28            28

GCC10, non-LTO

fizzy/parse/blake2b_mean                                          +0.0008         +0.0008            60            60            60            60
fizzy/instantiate/blake2b_mean                                    -0.0141         -0.0141            68            67            68            67
fizzy/execute/blake2b/512_bytes_rounds_1_mean                     -0.0023         -0.0023           217           216           217           216
fizzy/execute/blake2b/512_bytes_rounds_16_mean                    -0.0010         -0.0010          3288          3285          3288          3285
fizzy/parse/ecpairing_mean                                        +0.0070         +0.0070          3498          3522          3497          3522
fizzy/instantiate/ecpairing_mean                                  +0.0011         +0.0012          3622          3626          3622          3626
fizzy/execute/ecpairing/onepoint_mean                             +0.0006         -0.0005       1062430       1063074       1062394       1061910
fizzy/parse/keccak256_mean                                        +0.0040         +0.0039           110           111           110           111
fizzy/instantiate/keccak256_mean                                  -0.0048         -0.0048           121           120           121           120
fizzy/execute/keccak256/512_bytes_rounds_1_mean                   -0.0030         -0.0030           265           264           265           264
fizzy/execute/keccak256/512_bytes_rounds_16_mean                  -0.0053         -0.0053          3891          3870          3891          3870
fizzy/parse/memset_mean                                           +0.0020         +0.0019            15            15            15            15
fizzy/instantiate/memset_mean                                     -0.0108         -0.0109            22            22            22            22
fizzy/execute/memset/256_bytes_mean                               -0.0021         -0.0021            18            18            18            18
fizzy/execute/memset/60000_bytes_mean                             +0.0010         +0.0009          4045          4049          4045          4048
fizzy/parse/mul256_opt0_mean                                      +0.0040         +0.0039            19            19            19            19
fizzy/instantiate/mul256_opt0_mean                                -0.0091         -0.0091            26            26            26            26
fizzy/execute/mul256_opt0/input0_mean                             +0.0015         +0.0014            66            66            66            66
fizzy/execute/mul256_opt0/input1_mean                             +0.0027         +0.0027            65            66            65            66
fizzy/parse/ramanujan_pi_mean                                     +0.0042         +0.0041            63            64            63            64
fizzy/instantiate/ramanujan_pi_mean                               -0.0073         -0.0073            72            72            72            72
fizzy/execute/ramanujan_pi/33_runs_mean                           -0.0049         -0.0050           317           316           317           316
fizzy/parse/sha1_mean                                             +0.0043         +0.0042           100           101           100           101
fizzy/instantiate/sha1_mean                                       -0.0015         -0.0016           109           109           109           109
fizzy/execute/sha1/512_bytes_rounds_1_mean                        +0.0005         +0.0005           230           230           230           230
fizzy/execute/sha1/512_bytes_rounds_16_mean                       -0.0009         -0.0010          3216          3213          3216          3212
fizzy/parse/sha256_mean                                           +0.0090         +0.0089           165           166           165           166
fizzy/instantiate/sha256_mean                                     +0.0022         +0.0021           175           176           175           176
fizzy/execute/sha256/512_bytes_rounds_1_mean                      +0.0013         +0.0012           237           237           237           237
fizzy/execute/sha256/512_bytes_rounds_16_mean                     -0.0019         -0.0023          3263          3257          3263          3255
fizzy/parse/taylor_pi_mean                                        -0.0070         -0.0071             6             6             6             6
fizzy/instantiate/taylor_pi_mean                                  -0.0211         -0.0212            13            13            13            13
fizzy/execute/taylor_pi/pi_1000000_runs_mean                      -0.0009         -0.0009        101000        100911        100997        100902
fizzy/parse/micro/eli_interpreter_mean                            +0.0072         +0.0071            10            10            10            10
fizzy/instantiate/micro/eli_interpreter_mean                      -0.0151         -0.0152            17            17            17            17
fizzy/execute/micro/eli_interpreter/halt_mean                     -0.0015         -0.0016             0             0             0             0
fizzy/execute/micro/eli_interpreter/exec105_mean                  -0.0014         -0.0015            12            12            12            12
fizzy/parse/micro/factorial_mean                                  +0.0025         +0.0024             2             2             2             2
fizzy/instantiate/micro/factorial_mean                            +0.0059         +0.0058             3             3             3             3
fizzy/execute/micro/factorial/10_mean                             +0.0032         +0.0018             1             1             1             1
fizzy/execute/micro/factorial/20_mean                             -0.0008         -0.0010             2             2             2             2
fizzy/parse/micro/fibonacci_mean                                  -0.0021         -0.0022             3             3             3             3
fizzy/instantiate/micro/fibonacci_mean                            -0.0011         -0.0012             4             4             4             4
fizzy/execute/micro/fibonacci/24_mean                             +0.0008         +0.0007         17950         17964         17950         17962
fizzy/parse/micro/host_adler32_mean                               -0.0085         -0.0086             4             4             4             4
fizzy/instantiate/micro/host_adler32_mean                         +0.0049         +0.0048             9             9             9             9
fizzy/execute/micro/host_adler32/1_mean                           -0.2097         -0.2097             0             0             0             0
fizzy/execute/micro/host_adler32/100_mean                         +0.0047         +0.0046             8             8             8             8
fizzy/execute/micro/host_adler32/1000_mean                        -0.0125         -0.0126            78            77            78            77
fizzy/parse/micro/spinner_mean                                    +0.0054         +0.0053             2             2             2             2
fizzy/instantiate/micro/spinner_mean                              +0.0197         +0.0196             3             3             3             3
fizzy/execute/micro/spinner/1_mean                                -0.0079         -0.0080             0             0             0             0
fizzy/execute/micro/spinner/1000_mean                             +0.0047         +0.0046            28            28            28            28

@chfast
Copy link
Collaborator

chfast commented Sep 7, 2020

For me this is still good to merge this.

@gumb0 gumb0 force-pushed the instantiate-hpp branch 2 times, most recently from 47321bd to 06b5b47 Compare September 9, 2020 11:06
@axic
Copy link
Member

axic commented Sep 9, 2020

@gumb0 sorry for being late to the party, but the first commit renames execute to instantiate, which in practice means we value the history of instantiate code lines more, than the execute lines.

I would argue the history of execute() is more important in terms of finding out what changed when and how given that is the function we are trying to optimise.

So I suggest we do the inverse, and keep the execute.cpp file without renaming and move the instantiate portions into a new file.

@gumb0
Copy link
Collaborator Author

gumb0 commented Sep 9, 2020

@axic That rename is only in the branch, the final merge commit resolves it in a way that history is kept for both instantiate.* and execute.*, check it locally.

The following steps allow us to keep the history of both execute.* and instantiate.*:
1. In branch1 rename execute.* -> instantiate.* (git's history will consider instantiate to be the continuation of execute)
2. In branch1 remove execution code from instantiate.*
3. In branch2 rename instantiation code from execute.*
4. Merge branch1 into branch2.
@gumb0 gumb0 merged commit da2ed7c into master Sep 9, 2020
@gumb0 gumb0 deleted the instantiate-hpp branch September 9, 2020 13:27
@chfast chfast mentioned this pull request Sep 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants