Re: [ANN] faster-multimethods

2017-10-12 Thread John McDonald
I think it would be a good idea to some feedback and more widespread use first. I've started the process with https://dev.clojure.org/jira/browse/CLJ-2234. The other semantic changes need more review. The main performance change to clojure.lang.MultiFn is to replace persistent data structures by

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
t; that carries data that counts in equality checks seems a bit overboard to > me, since a record implementing IFn does this for very little trouble. > > On Wed, Sep 20, 2017 at 12:58 PM John McDonald > wrote: > >> I've done something like this in the past. >> >

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
hash-map. It's not > too hard to implement if you know the precise arg count you need to > support, and I'd be interested to see how the performance compares. > > On Wed, Sep 20, 2017 at 11:57 AM John McDonald > wrote: > >> 2nd issue: Benchmarks >> >>

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
ASM: I haven't done anything with ASM before. Any advice would be greatly appreciated. What I have in mind is using the org.ow2.asm, not the internal clojure.asm. I am imagining I can take a function's class and add 'implements IObj', a 'meta' field, and the necessary methods, and pass through e

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
t 12:05 PM, John McDonald wrote: > 3rd issue: metadata and function equality: > > I've never really understood the motivation for "Two objects that differ > only in metadata are equal." > Is there a good reference for that? > > For my purposes, it would probably

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
shouldn't be overloading the metadata mechanism after all? On Wed, Sep 20, 2017 at 11:57 AM, John McDonald wrote: > 2nd issue: Benchmarks > > I use both criterium and simple 'run repeatedly and divide the clock time'. > > I've had trouble getting consi

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
lisades/lakes/funx/l2norm/msec.clj These both use general benchmarking code from https://github.com/palisades-lakes/benchtools The experimental metadata function wrapper is in: https://github.com/palisades-lakes/dynamic-functions/blob/dynesty/src/main/java/palisades/lakes/dynafun/java/MetaFn.java On W

Re: functions with metadata, 2 problems: performance hit and equality not preserved.

2017-09-20 Thread John McDonald
Thanks for the quick response. One issue at a time: (A) Putting metadata on Vars instead of on the functions themselves: I need to be able to associate facts with the function instances. I can't rely on every function being bound to a Var. For example, I'm constructing cost functions for machine

Why no anonymous record types, or (defstruct, create-struct) vs (defrecord, ???)

2011-11-14 Thread John McDonald
Structmaps can be defined either named, thru the defstruct macro, or anonymously, thru the create-struct function call. Record types must be named and defined thru a call to defrecord. This seems to contradict one of the Clojure library coding standards (http://dev.clojure.org/display/design/Libr