It was non-optimized. After reading your response, I spent couple of hours on optimizing it. Here are the numbers:
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
