Invoke elements in PAM -conj

Description

In the PAM -conj implementation, -nth is used, but instead invoking the vector or map entry on the desired index is faster by about 10% on V8 and JavaScriptCore.

For example, to get the first element, instead of (-nth x 0), (x 0). See for justification / check that would allow us to safely assume that (x 0) and (x 1) are valid.

Additionally, in the branch where it is dealing with map entries, not only is (x 0) faster, but (-key x) is even faster (in particular in :none on JavaScriptCore). argues that we should be able to assume map entries in this portion of the code.

Environment

None

Assignee

Unassigned

Reporter

Mike Fikes

Labels

Approval

None

Patch

None

Priority

Major
Configure