Skip to content

Conversation

@radarroark
Copy link
Contributor

@radarroark radarroark commented Jan 10, 2026

Currently, when patch adds/replaces values in vectors, it creates two subvecs and concatenates them. Concatenation is O(n) for normal Clojure vectors so this is inefficient. This PR makes patch replace values in vectors with assoc, and add values in vectors with conj if the value is being added at the end of the vector.

I also replaced (set/difference x #{p}) with (disj x p). This may not affect performance but I figured it's more readable, and lets you remove dependence on the clojure.set ns.

Copy link
Contributor

@huahaiy huahaiy left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@huahaiy huahaiy merged commit a259a8c into juji-io:master Jan 12, 2026
@radarroark
Copy link
Contributor Author

Thanks @huahaiy. If you don't intend to cut a release soon, could you add a deps.edn file to the root of the repo so editscript can be pulled by clojure CLI as a git dep? Even just putting {:paths ["src"]} in the file would be enough to make it work.

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.

2 participants