Optimization: lookup of default in destructure could be done only once

Description

In this section of destructure the default value is looked up twice:

This could be optimized by using find and val:

Isolated difference:

In the grand scheme of things, this optimization may not be noticeable.

With destructure2 being destructure with the patch:

Environment

None

Activity

Show:
Alex Miller
November 5, 2020, 2:41 PM

I re-ran the last test but in a compiled clojure and actually saw slightly slower times with the change, so certainly doesn't seem obviously better, and possibly worse. Closing...

Not Reproducible
Your pinned fields
Click on the next to a field label to start pinning.

Assignee

Alex Miller

Reporter

Michiel Borkent

Approval

Triaged

Patch

Code

Priority

Minor

Fix versions