0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-03 04:49:03 -05:00

Fix a performance regression with file validation with some features

The feature fdata/pointer-map tracking mechanism interacts pretty bad
with possible local mutations on the validation subsystem. The fix
consist on disabling the tracking mechanism on the validation.
This commit is contained in:
Andrey Antukh 2024-06-17 15:56:06 +02:00
parent e0906be6e7
commit 293b460cab

View file

@ -324,19 +324,21 @@
(update :data cpc/process-changes changes) (update :data cpc/process-changes changes)
(update :data d/without-nils))] (update :data d/without-nils))]
(when (contains? cf/flags :soft-file-validation)
(soft-validate-file! file libs))
(when (contains? cf/flags :soft-file-schema-validation) (binding [pmap/*tracked* nil]
(soft-validate-file-schema! file)) (when (contains? cf/flags :soft-file-validation)
(soft-validate-file! file libs))
(when (and (contains? cf/flags :file-validation) (when (contains? cf/flags :soft-file-schema-validation)
(not skip-validate)) (soft-validate-file-schema! file))
(val/validate-file! file libs))
(when (and (contains? cf/flags :file-schema-validation) (when (and (contains? cf/flags :file-validation)
(not skip-validate)) (not skip-validate))
(val/validate-file-schema! file)) (val/validate-file! file libs))
(when (and (contains? cf/flags :file-schema-validation)
(not skip-validate))
(val/validate-file-schema! file)))
(cond-> file (cond-> file
(contains? cfeat/*current* "fdata/objects-map") (contains? cfeat/*current* "fdata/objects-map")