Skip to content

Significant compilation time increase with --llzk concrete --llzk_plaintext #445

Description

@alexcere

We have noticed significant compilation slowdowns when compiling the circuits in the circomlib with the llzk option enabled compared to the default pipeline. We are using the following commits:

Below are the average compilation times and standard deviations after 5 executions. The table compares the default pipeline with no flags enabled (Plain* results) against the pipeline using the flags --llzk concrete --llzk_plaintext (Concrete* results), sorted by the largest average time difference (Diff (s)):

File Concrete avg (s) Concrete std Plain avg (s) Plain std Diff (s)
poseidonex_test.circom 51.7255 1.8523 0.6362 0.0205 51.0893
smtprocessor10_test.circom 39.4369 2.5737 0.6428 0.0649 38.7941
eddsaposeidon_test.circom 38.905 2.0762 0.8399 0.0846 38.065
poseidon6_test.circom 37.3933 2.4227 0.3866 0.0561 37.0066
smtverifier10_test.circom 34.8534 0.3879 0.4944 0.0133 34.3591
poseidon3_test.circom 33.2177 1.8266 0.3176 0.0464 32.9001
pedersen_test.circom 15.1396 0.6857 1.6956 0.2112 13.444
sha256_2_test.circom 9.7156 0.6344 2.3768 0.1277 7.3388
sha256_test512.circom 10.8813 0.6264 3.7449 0.2311 7.1364
escalarmul_test.circom 8 0.3983 0.9132 0.1386 7.0868
sha256_test448.circom 10.4752 0.8304 3.4998 0.1767 6.9754
escalarmul_min_test.circom 7.6751 0.2403 0.7601 0.0418 6.915
escalarmul_test_min.circom 7.6009 0.159 0.765 0.058 6.8359
eddsa_test.circom 2.641 0.0939 0.7936 0.0859 1.8473
eddsamimc_test.circom 1.8469 0.1425 0.4823 0.0583 1.3646
escalarmulfix_test.circom 0.952 0.0533 0.194 0.0046 0.758
babypbk_test.circom 0.9166 0.0852 0.2268 0.0103 0.6898
pedersen2_test.circom 0.8485 0.0648 0.1923 0.0201 0.6562
escalarmulany_test.circom 0.7133 0.101 0.2586 0.0821 0.4546
mimc_sponge_hash_test.circom 0.4778 0.0553 0.082 0.0125 0.3957
mimc_sponge_test.circom 0.3815 0.0291 0.0506 0.0037 0.331
mux4_1.circom 0.2259 0.0145 0.045 0.0101 0.1809
pointbits_loopback.circom 0.4375 0.0571 0.2718 0.027 0.1657
mimc_test.circom 0.1759 0.0111 0.0273 0.0032 0.1486
constants_test.circom 0.1333 0.0179 0.0257 0.0027 0.1076
mux3_1.circom 0.132 0.0089 0.0355 0.004 0.0965
mux2_1.circom 0.1051 0.0044 0.0334 0.0048 0.0717
sum_test.circom 0.1142 0.0206 0.0613 0.0188 0.0529
binsub_test.circom 0.0887 0.0073 0.0396 0.006 0.0491
sign_test.circom 0.1103 0.0184 0.0621 0.0129 0.0482
mux1_1.circom 0.0766 0.0033 0.032 0.0052 0.0446
escalarmulw4table_test.circom 0.0652 0.0079 0.0232 0.0043 0.042
escalarmulw4table.circom 0.0609 0.0047 0.0194 0.0026 0.0415
aliascheck_test.circom 0.1032 0.0081 0.0633 0.0051 0.0399
escalarmulw4table_test3.circom 0.0609 0.0026 0.0211 0.0034 0.0398
greatereqthan.circom 0.0588 0.0082 0.0303 0.0039 0.0284
greaterthan.circom 0.0546 0.0072 0.027 0.0015 0.0276
lesseqthan.circom 0.0622 0.0019 0.0373 0.005 0.0248
montgomerydouble.circom 0.035 0.0017 0.0189 0.0027 0.0161
lessthan.circom 0.0622 0.015 0.0464 0.0251 0.0158
babyadd_tester.circom 0.0631 0.0093 0.0486 0.0071 0.0145
isequal.circom 0.0438 0.0066 0.0306 0.0045 0.0132
edwards2montgomery.circom 0.0315 0.0052 0.0203 0.0033 0.0112
montgomeryadd.circom 0.0465 0.0149 0.0374 0.0103 0.0091
montgomery2edwards.circom 0.028 0.0033 0.02 0.0043 0.008
babycheck_test.circom 0.0532 0.0039 0.0456 0.0042 0.0076
iszero.circom 0.043 0.0112 0.0435 0.0174 -0.0004

Conversely, removing the --llzk_plaintext flag drastically improves compilation times, though they remain slower than the default pipeline:

File Concrete avg (s) Concrete std Plain avg (s) Plain std Diff (s)
poseidonex_test.circom 8.1916 0.3461 0.7397 0.0701 7.4519
eddsaposeidon_test.circom 7.4566 0.5984 0.9794 0.1456 6.4772
poseidon6_test.circom 6.7975 0.4075 0.528 0.0991 6.2695
smtprocessor10_test.circom 6.9465 1.1708 0.7938 0.2361 6.1527
poseidon3_test.circom 6.172 0.3808 0.3635 0.0544 5.8085
smtverifier10_test.circom 5.5381 0.1263 0.541 0.0369 4.9972
pedersen_test.circom 3.328 0.3637 1.7848 0.1611 1.5431
sha256_test512.circom 5.4597 0.9642 4.0876 0.7881 1.3721
sha256_2_test.circom 4.4663 0.4451 3.1329 0.3626 1.3334
sha256_test448.circom 4.5044 0.0783 3.5049 0.0799 0.9994
escalarmul_test_min.circom 1.5701 0.1334 0.8627 0.0315 0.7074
escalarmul_min_test.circom 1.5578 0.1636 0.8529 0.0466 0.7049
escalarmul_test.circom 1.6332 0.1034 1.0312 0.1007 0.602
eddsamimc_test.circom 0.8616 0.0897 0.552 0.0658 0.3095
eddsa_test.circom 1.1462 0.0585 0.9216 0.0852 0.2247
pedersen2_test.circom 0.368 0.027 0.2162 0.0135 0.1519
babypbk_test.circom 0.3898 0.0638 0.2451 0.0259 0.1446
escalarmulfix_test.circom 0.3567 0.0496 0.2272 0.0211 0.1295
escalarmulany_test.circom 0.3488 0.0374 0.2196 0.0218 0.1292
mimc_sponge_hash_test.circom 0.2075 0.0196 0.1004 0.0135 0.107
mimc_sponge_test.circom 0.1299 0.0091 0.056 0.0082 0.0739
pointbits_loopback.circom 0.3573 0.0505 0.298 0.0389 0.0592
mimc_test.circom 0.094 0.0208 0.0414 0.0084 0.0526
mux4_1.circom 0.0866 0.0057 0.0456 0.0064 0.041
constants_test.circom 0.0464 0.0038 0.0208 0.0027 0.0256
mux3_1.circom 0.0635 0.0049 0.0386 0.0009 0.0249
sign_test.circom 0.0803 0.0123 0.0595 0.0036 0.0208
mux1_1.circom 0.0544 0.0075 0.0351 0.0038 0.0192
mux2_1.circom 0.0606 0.009 0.0433 0.0089 0.0173
binsub_test.circom 0.0554 0.0057 0.041 0.0058 0.0144
montgomeryadd.circom 0.0412 0.0112 0.0281 0.0046 0.0131
sum_test.circom 0.0814 0.0054 0.0685 0.0079 0.0129
escalarmulw4table_test.circom 0.0382 0.0072 0.0261 0.0064 0.0121
lesseqthan.circom 0.0487 0.0029 0.0378 0.0038 0.0108
greatereqthan.circom 0.0443 0.0027 0.0336 0.0021 0.0107
escalarmulw4table_test3.circom 0.0361 0.0031 0.0254 0.0032 0.0107
edwards2montgomery.circom 0.0317 0.0043 0.0219 0.0034 0.0098
greaterthan.circom 0.0456 0.0034 0.0365 0.0021 0.0091
aliascheck_test.circom 0.0731 0.0044 0.0646 0.0057 0.0085
montgomerydouble.circom 0.0308 0.0035 0.0229 0.0034 0.0079
isequal.circom 0.0424 0.0062 0.0347 0.0036 0.0077
escalarmulw4table.circom 0.045 0.011 0.0385 0.017 0.0065
babycheck_test.circom 0.0548 0.0066 0.0497 0.0072 0.0052
lessthan.circom 0.0427 0.0073 0.0388 0.0076 0.0039
iszero.circom 0.0374 0.0013 0.0342 0.0043 0.0033
babyadd_tester.circom 0.0566 0.0088 0.054 0.0061 0.0027
montgomery2edwards.circom 0.0271 0.0011 0.0248 0.004 0.0023

The raw data can be found in the following files:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions