zkemail / zk-regex

A library to do regex verification in circom, adapted from the original zk-email. It additionally generates lookup tables for halo2-regex.
GNU General Public License v3.0
79 stars 27 forks source link

discrepancy in circom compiling time #2

Closed katat closed 1 year ago

katat commented 1 year ago

Somehow the circom compiler takes a significantly long time to compile the same circuit with different signal variable names.

For example, the naming difference in this code introduces a significant difference in compiling time. This is quite strange as the naming difference isn't introduced a difference in the circuit logic. The compiling time should be the same when the signal variable naming differs.

For now, the naming of the variables is reverted to make the compilation faster. But in the long run, this would be a potential issue in maintenance. This issue is for tracking the issue.

alrubio commented 1 year ago

Thanks for reporting. This can be related to the simplification phase, which is a costly process that uses some heuristics that can be affected by the order in which signals are treated. In general, signal names does not affect the process but component names may affect it. Can you provide us with the full circom circuit? I tried to download them from the git but the files cannot be compiled. If so we can see what's happening.