On Tue, Oct 30, 2012 at 2:21 PM, Azer Koçulu <[email protected]> wrote:

> You mean that benchmark doesn't contain any accessor or ak47 misses
> accessors?
>
> Here is how I define a property with getters and setters using ak47:
>
> function getter(d){ return Number(d); }
> function setter(d){ return new Date(d); }
>
> var date = a.property(new Date('1.1.1990'), getter, setter);
>
> And that benchmark case uses default accessors unlike the example above.
>

A little misleading, because what you're illustrating is actually just "a
function". JavaScript accessors are created by defining get/set property
descriptors or named get/set accessors.

Rick



>
> On Tue, Oct 30, 2012 at 11:04 AM, Rick Waldron <[email protected]>
> wrote:
> >
> >
> > On Tue, Oct 30, 2012 at 1:37 PM, Azer Koçulu <[email protected]> wrote:
> >>
> >> It was non-optimized. After reading your response, I spent couple of
> >> hours on optimizing it. Here are the numbers:
> >
> >
> > Just a heads up... The "thing" you're calling "accessors" are not
> actually
> > accessors.
> >
> >
> > Rick
> >
> >
> >>
> >>
> >> Before optimization:
> >>
> >> ak47-accessors: 7495ms
> >> ak47-sub: 6963ms
> >> ak47-subAll: 7785ms
> >> ak47-pubsub: 6780ms
> >>
> >> After optimization (v0.0.5)
> >>
> >> ak47-accessors: 851ms
> >> ak47-sub: 873ms
> >> ak47-subAll: 1277ms
> >> ak47-pubsub: 1868ms
> >>
> >> And here how I measure it:
> >> https://github.com/azer/ak47/blob/master/benchmarks/index.js
> >>
> >> On Mon, Oct 29, 2012 at 7:43 PM, Jake Verbaten <[email protected]>
> wrote:
> >> > Is that the original non-optimized prototype or more optimized
> iteration
> >> > of
> >> > it?
> >> >
> >> >
> >> > On Mon, Oct 29, 2012 at 5:42 PM, Rick Waldron <[email protected]
> >
> >> > wrote:
> >> >>
> >> >> Related... v8 just landed support for Object.observe()
> >> >>
> >> >> -Rick
> >> >>
> >> >> On Monday, October 29, 2012 at 8:11 PM, Azer Koçulu wrote:
> >> >>
> >> >> Hi All,
> >> >>
> >> >> I've created a new JS library for defining properties that can be
> >> >> subscribed for updates and can interact with eachother.
> >> >>
> >> >> Check it here;
> >> >>
> >> >> https://github.com/azer/ak47
> >> >>
> >> >> Readme contains many examples. Here is another one:
> >> >>
> >> >> var user = ak47({ name: 'joe', 'birthdate': 21 });
> >> >>
> >> >> > user.name()
> >> >> "joe"
> >> >> > user.name.subscribe(console.log);
> >> >> > user.name("mike")
> >> >> "mike"
> >> >> "mike" "joe"
> >> >>
> >> >> Defining a new property that observes another(s):
> >> >>
> >> >> > var greeting = ak47(joe.name, function(name){
> >> >> return 'Hello ' + name;
> >> >> });
> >> >> > greeting()
> >> >> "Hello mike"
> >> >> > joe.name("joe")
> >> >> > greeting()
> >> >> "Hello joe"
> >> >>
> >> >> What do you think?
> >> >>
> >> >> Azer
> >> >>
> >> >> --
> >> >> Job Board: http://jobs.nodejs.org/
> >> >> Posting guidelines:
> >> >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> >> >> You received this message because you are subscribed to the Google
> >> >> Groups "nodejs" group.
> >> >> To post to this group, send email to [email protected]
> >> >> To unsubscribe from this group, send email to
> >> >> [email protected]
> >> >> For more options, visit this group at
> >> >> http://groups.google.com/group/nodejs?hl=en?hl=en
> >> >>
> >> >>
> >> >> --
> >> >> Job Board: http://jobs.nodejs.org/
> >> >> Posting guidelines:
> >> >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> >> >> You received this message because you are subscribed to the Google
> >> >> Groups "nodejs" group.
> >> >> To post to this group, send email to [email protected]
> >> >> To unsubscribe from this group, send email to
> >> >> [email protected]
> >> >> For more options, visit this group at
> >> >> http://groups.google.com/group/nodejs?hl=en?hl=en
> >> >
> >> >
> >> > --
> >> > Job Board: http://jobs.nodejs.org/
> >> > Posting guidelines:
> >> > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> >> > You received this message because you are subscribed to the Google
> >> > Groups "nodejs" group.
> >> > To post to this group, send email to [email protected]
> >> > To unsubscribe from this group, send email to
> >> > [email protected]
> >> > For more options, visit this group at
> >> > http://groups.google.com/group/nodejs?hl=en?hl=en
> >>
> >> --
> >> Job Board: http://jobs.nodejs.org/
> >> Posting guidelines:
> >> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> >> You received this message because you are subscribed to the Google
> >> Groups "nodejs" group.
> >> To post to this group, send email to [email protected]
> >> To unsubscribe from this group, send email to
> >> [email protected]
> >> For more options, visit this group at
> >> http://groups.google.com/group/nodejs?hl=en?hl=en
> >
> >
> > --
> > Job Board: http://jobs.nodejs.org/
> > Posting guidelines:
> > https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> > You received this message because you are subscribed to the Google
> > Groups "nodejs" group.
> > To post to this group, send email to [email protected]
> > To unsubscribe from this group, send email to
> > [email protected]
> > For more options, visit this group at
> > http://groups.google.com/group/nodejs?hl=en?hl=en
>
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to