ClojureScript

Redundant bounds checking in indexed types

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    r2156

Description

PersistentVector and TransientVector contain code paths where a bounds check is performed more than once unnecessarily.

  1. cljs-757.patch
    24/Feb/14 12:22 AM
    6 kB
    Francis Avila
  2. cljs-757.patch
    29/Jan/14 11:44 PM
    6 kB
    Francis Avila

Activity

Hide
Francis Avila added a comment -

Patch gives a minor across-the-board speedup on vector operations.

I also discovered and fixed an off-by-one check in PersistentVector's -seq, which causes an unnecessary ChunkedSeq to be created when vector length is exactly 32.

Show
Francis Avila added a comment - Patch gives a minor across-the-board speedup on vector operations. I also discovered and fixed an off-by-one check in PersistentVector's -seq, which causes an unnecessary ChunkedSeq to be created when vector length is exactly 32.
Hide
David Nolen added a comment -

Can we get a rebased version of this patch? Thanks.

Show
David Nolen added a comment - Can we get a rebased version of this patch? Thanks.
Hide
Francis Avila added a comment -

Rebased cljs-757 with a change to unchecked-array-for-longvec (now first-array-for-longvec) and extra comments documenting invariants.

Show
Francis Avila added a comment - Rebased cljs-757 with a change to unchecked-array-for-longvec (now first-array-for-longvec) and extra comments documenting invariants.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: