ClojureScript

Lazy initialize global-hierarchy

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code

Description

Depends on extend-instance http://dev.clojure.org/jira/browse/CLJS-398

First patch backs atoms by a protocol IPlace and implements reset! and swap! and compare-and-set! only with protocols

Second patch uses extend-instance to implement global-hierarchy a custom lazy atom

In effect, multimethods and hierarchies can be omitted by gclosure, taking 1K off of hello world

https://groups.google.com/d/topic/clojure/LNfJRw07u8I/discussion

Activity

Hide
David Nolen added a comment -

The protocol should probably just be called IAtom. A note, changing atoms to go through protocols has performance implications - generally protocol fns are about twice as slow as regular fns.

I'll take a closer look.

Show
David Nolen added a comment - The protocol should probably just be called IAtom. A note, changing atoms to go through protocols has performance implications - generally protocol fns are about twice as slow as regular fns. I'll take a closer look.
Hide
David Nolen added a comment -

this has already been done in master by Brandon Bloom

Show
David Nolen added a comment - this has already been done in master by Brandon Bloom

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: