Welcome! Please see the About page for a little more info on how this works.

+13 votes
in Sequences by
retagged by

Sorry for doing it backward and submitting the ticket /patch first. The ticket is here: https://clojure.atlassian.net/jira/software/c/projects/CLJ/issues/CLJ-2786

The ticket contains all the important details, benchmarking results, and code. Here I would like to hear whether people generally use transients, how they decide if transients will lead to performance improvement rather than degradation, and any other possible doubts. I always had mixed feelings when doing something through transients, probably due to a section in Joy of Clojure claiming that transients are inefficient for small inputs. The benchmark done with the current version of Clojure overall confirms that.

Does the change impact the object's hash or equality semantics?
I'm confident that it does not. The patch introduces no new concepts – in the current implementation, all the nodes but the root one are already copied on-demand, and only the root is copied upfront. The patch simply extends the already existing behavior to the root.
For the curious, could you post your patch to Github? :)
Hello Janet! You can view the patch in the ticket: https://clojure.atlassian.net/jira/software/c/projects/CLJ/issues/CLJ-2786; it can be found in the attachments. Or are you asking to upload it to Github since it's not too readable as plain text?
Hey Alex, I didn't even realize that was a git diff at first. Yeah I was hoping for a branch on github or something :P
Indeed, a raw patch is not the most human-friendly thing to look at in the browser. When viewed locally, most editors will at least colorize the changes, but you still can't navigate it as well as a git commit within the repo.

The thing is, sending patches is the only accepted workflow for contributing code to Clojure. That is why you'll see those Jira tickets with patches attached and no PRs on Github.

Anyway, here is my commit on Github: https://github.com/alexander-yakushev/clojure/commit/9d12dec06e4a9e0ec21e1b43741dc7d6adafc45e

Please log in or register to answer this question.