mirror of
https://github.com/Veridise/Picus.git
synced 2026-04-19 03:00:11 -04:00
Prior this commit, `read-r1cs` copied bytes in the file over and over again in a hot loop, causing the time complexity to be quadratic. This commit switches to use index-based access in the hot loop instead, resulting in a large performance improvement. The benchmark file that accompanies this fix took 30 minutes to successfully parse (according to @shankarapailoor). This commit reduces the parsing time to 2 seconds. It should be noted that not all bytes copying is avoided, since bytes copying outside the hot loop, although not ideal, does not really impact the performance.