Message from discussion
Observable Properties
Received: by 10.43.8.201 with SMTP id ot9mr20369112icb.10.1351618687702;
Tue, 30 Oct 2012 10:38:07 -0700 (PDT)
X-BeenThere: nodejs@googlegroups.com
Received: by 10.42.161.7 with SMTP id r7ls1383919icx.9.gmail; Tue, 30 Oct 2012
10:37:49 -0700 (PDT)
Received: by 10.66.75.100 with SMTP id b4mr9991198paw.35.1351618669031;
Tue, 30 Oct 2012 10:37:49 -0700 (PDT)
Received: by 10.66.75.100 with SMTP id b4mr9991197paw.35.1351618669021;
Tue, 30 Oct 2012 10:37:49 -0700 (PDT)
Return-Path: <a...@kodfabrik.com>
Received: from mail-pb0-f41.google.com (mail-pb0-f41.google.com [209.85.160.41])
by gmr-mx.google.com with ESMTPS id yl8si362866pbc.1.2012.10.30.10.37.48
(version=TLSv1/SSLv3 cipher=OTHER);
Tue, 30 Oct 2012 10:37:48 -0700 (PDT)
Received-SPF: neutral (google.com: 209.85.160.41 is neither permitted nor denied by best guess record for domain of a...@kodfabrik.com) client-ip=209.85.160.41;
Authentication-Results: gmr-mx.google.com; spf=neutral (google.com: 209.85.160.41 is neither permitted nor denied by best guess record for domain of a...@kodfabrik.com) smtp.mail=a...@kodfabrik.com
Received: by mail-pb0-f41.google.com with SMTP id rq2so379945pbb.0
for <nodejs@googlegroups.com>; Tue, 30 Oct 2012 10:37:48 -0700 (PDT)
d=google.com; s=20120113;
h=mime-version:in-reply-to:references:from:date:message-id:subject:to
:content-type:content-transfer-encoding:x-gm-message-state;
bh=MtAU3tM6yikPtyU+RXAW5RHylh9kQfTm07bip/zJQUU=;
b=ec3wx0cw5wKm/o2jo6fZ0U1TAudj8umcLgdEqc0dYYDdR9oggS/zC9/HIhL7LJHJem
PcDd8q5zedDySmD0wwkYAM5YTqAjor16VtokvRpUhQHELZcLX7laaRkflsMKC5F4tfXv
rnsXftxcOz/0p6ikXswRxwotbpWar7SYfxG/PTVzZUzsegz0VpwlUxjKPeqrhPnNiCVH
vJoTN1Ky2WJiJ+EWd7IM50pu3Bby8ts4lfjCLkvMofjhm6Of5csSe4IzVn8SooJ2ZdVM
JNocB6J1lll+INXNJFYj5htqY64AtfL4IPmu78X4StRG8q8NiDdJt60QKKpmu1kwVFa5
3YuA==
Received: by 10.66.88.197 with SMTP id bi5mr93753237pab.58.1351618668582; Tue,
30 Oct 2012 10:37:48 -0700 (PDT)
MIME-Version: 1.0
Received: by 10.66.162.162 with HTTP; Tue, 30 Oct 2012 10:37:28 -0700 (PDT)
In-Reply-To: <CAMCMjp0TUKJSOX4h-9YGz356JKLduuTRjmLiKSE2koGfj5-...@mail.gmail.com>
References: <CALoL_S45rVSV2=_V_4byr99fP43sCnYzav0Uymon94+Dfv6...@mail.gmail.com>
<CALoL_S7L2hjD9okkmMRn7J8fgKdO41d8FUCvocGHN_3k+G5...@mail.gmail.com>
<81082513FAF5429582737A82D6787...@gmail.com> <CAMCMjp0TUKJSOX4h-9YGz356JKLduuTRjmLiKSE2koGfj5-...@mail.gmail.com>
From: =?ISO-8859-1?Q?Azer_Ko=E7ulu?= <a...@kodfabrik.com>
Date: Tue, 30 Oct 2012 10:37:28 -0700
Message-ID: <CALoL_S5ogKZbQvrqVH2+b1OY+W+7OGg966ZUe2ywxEfGHsF...@mail.gmail.com>
Subject: Re: [nodejs] Observable Properties
To: nodejs@googlegroups.com
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Gm-Message-State: ALoCoQmGq7mHSMdGol4b0YTjrC+OoYA+KCB0LoAktkxv/P7ymmHcIWaaYth8AhVTeSV+g6LiRqvf
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 <rayn...@gmail.com> 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 <waldron.r...@gmail.com>
> wrote:
>>
>> Related... v8 just landed support for Object.observe()
>>
>> -Rick
>>
>> On Monday, October 29, 2012 at 8:11 PM, Azer Ko=E7ulu 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 =3D 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 =3D 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 nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscribe@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=3Den?hl=3Den
>>
>>
>> --
>> 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 nodejs@googlegroups.com
>> To unsubscribe from this group, send email to
>> nodejs+unsubscribe@googlegroups.com
>> For more options, visit this group at
>> http://groups.google.com/group/nodejs?hl=3Den?hl=3Den
>
>
> --
> 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 nodejs@googlegroups.com
> To unsubscribe from this group, send email to
> nodejs+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=3Den?hl=3Den