ClojureScript

protocol dispatch performance enhancement & extend-type to nil

Details

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

Description

Currently we extend to nil to a bunch of protocols, while this was convenient for the initial implementation this has many unfortunate performance consequences. We should probably not extend nil to anything and deal with the nil value directly as is done in Clojure on the JVM. In addition we can add a special ^not-native type-hint. In critical paths this would allow us to inline calls directly to protocol implementations.

Perhaps this could also allow us to hint with ^native to inline calls to the native tables.

Activity

Hide
David Nolen added a comment -

There are other tickets now that represent a comprehensive path towards optimizing away protocol overheads.

Show
David Nolen added a comment - There are other tickets now that represent a comprehensive path towards optimizing away protocol overheads.
Hide
David Nolen added a comment -

^not-native support is already in master and does deliver performance benefits in the cases where native types need not be considered.

Show
David Nolen added a comment - ^not-native support is already in master and does deliver performance benefits in the cases where native types need not be considered.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: