the commons

closure core count

2 moment(s) that assert this concept — showing 1–2 of 2

single sourceRests on a single channel — treat as a lead, verify independently
↣ how this spread over time →
provenance — click a node to open its encoding unit
[1] ClojureTV[2] ClojureTV
showing 2 of 2 moments
ClojureTV · youtube · en-US
1The cost of using a unifying abstraction like closure core count is low when dealing with vectors, maps, or sets because it proxies to a simple Java function with minimal overhead.
“Closure laying RT count is pretty straightforward. It checks whether or not it's an instance of closure laying counted, which is true of a vector or a map or a set. And if it is, it calls .count. Otherwise, it calls count from, which is a slightly more complex function, which has handlers”
spoken · 480s · 2014-03-25
ClojureTV · youtube · en-US
2A micro-benchmark shows that calling closure core count takes approximately 10 nanoseconds, while calling .count directly takes about 5 nanoseconds, indicating the overhead is minimal.
“Calling closure core count is approximately 10 nanoseconds. Calling dot count directly is about five and you may notice that this is in fact twice as much time but let us never forget that a nanosecond is not a very long amount of time.”
spoken · 510s · 2014-03-25