From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-iy0-f171.google.com (mail-iy0-f171.google.com [209.85.210.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (verified OK)) by huchra.bufferbloat.net (Postfix) with ESMTPS id 3006F200252 for ; Tue, 13 Dec 2011 14:52:41 -0800 (PST) Received: by iaen33 with SMTP id n33so391189iae.16 for ; Tue, 13 Dec 2011 14:52:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=cSkrDRAlX6RS2l0mdSzsKtG+qmw7mVmNW8a1rsrsUlU=; b=aeoidUf1irDwdOtts5NqRP3ZXRyR6MSJl7YxJrbfMMa1Hj5dyPA+HsfIrF7aWEHFuL ++DT6dpmYPgI4d3fbshEXOISHU7KShatIz6YrxTiYh9427+ywk4vlKlfMoidduH4yc1T lMh9FM8WV9eUXkMcOI+mi0nQUWhJVt5F1iur4= MIME-Version: 1.0 Received: by 10.50.217.199 with SMTP id pa7mr15825860igc.48.1323816758823; Tue, 13 Dec 2011 14:52:38 -0800 (PST) Received: by 10.231.204.83 with HTTP; Tue, 13 Dec 2011 14:52:38 -0800 (PST) In-Reply-To: References: Date: Tue, 13 Dec 2011 23:52:38 +0100 Message-ID: From: Dave Taht To: cerowrt-devel@lists.bufferbloat.net Content-Type: multipart/alternative; boundary=14dae9341101a84bab04b4011b93 Subject: Re: [Cerowrt-devel] Adopting lua X-BeenThere: cerowrt-devel@lists.bufferbloat.net X-Mailman-Version: 2.1.13 Precedence: list List-Id: Development issues regarding the cerowrt test router project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Dec 2011 22:52:41 -0000 --14dae9341101a84bab04b4011b93 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Tue, Dec 13, 2011 at 10:52 PM, Dave Taht wrote: > One both good and horrible thing I did back in june... > > http://lists.noise.gatech.edu/pipermail/bismark-devel/2011-July/000251.ht= ml > > was to swap the default gui from xwrt to luci. Good, in that that GUI > keeps getting better and better. Bad, because neither jim, nor I, know lu= a > the language at all, and can't add features nor fix gui issues. > > I've learned a lot of languages in my life, but can write shell and C an= d > SQL in my sleep. In olden days I could count LISP among those, too, and a > dozen others, but not of late. > > Recently I shot myself in the foot, trying to scale kleinrock up and down > by doing a simple lookup table for 'sqrt' for various amounts of flows in > the various AQM attempts I have going using 'tc' in the deBloat.git repo. > The numbers were so off from correct, that I realized that I really neede= d > to take a sqrt directly... > > and the only way to do that (or so I thought) was to write a shell script > wrapper around 'bc'... > > and to get bc, I needed to compile and install it on cerowrt. > > Not only that, but the shell script was horribly slow, taking 2 minutes i= n > one version, to create the tc rules. I rewrote it in C, cutting that time > down to 6 ms (and getting my !@! sqrt function for free), but that lacks > the run time flexibility of an interpreter. > > Then I realized that lua could do the job... > > lua -e "print(math.sqrt(12))" > > and then I realized, why not try writing the AQM stuff entirely in lua an= d > see if I got a good compromise between shell and C. > > and finally be able to do gui stuff, eventually. > > It's an odd way to bite the bullet and decide to try to learn a new > language, but, there it is. > translated the c into lua (t minus whenever I sent this message) time ./htb-bt-qfq-red-4mbit > /dev/null real 0m1.762s user 0m0.180s sys 0m0.330s d@cruithne:~/git/deBloat/src$ time ./a.out > /dev/null real 0m0.025s user 0m0.020s sys 0m0.000s d@cruithne:~/git/deBloat/src$ time ./test.lua > /dev/null real 0m0.090s user 0m0.083s sys 0m0.007s Moving to lua, I think, is wise. > > > -- > Dave T=E4ht > SKYPE: davetaht > US Tel: 1-239-829-5608 > FR Tel: 0638645374 > http://www.bufferbloat.net > --=20 Dave T=E4ht SKYPE: davetaht US Tel: 1-239-829-5608 FR Tel: 0638645374 http://www.bufferbloat.net --14dae9341101a84bab04b4011b93 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable

On Tue, Dec 13, 2011 at 10:52 PM, Dave T= aht <dave.taht@= gmail.com> wrote:
One both good and horrible thing I did back in june...

http://lists.noise.gatech.edu/pipermail/bis= mark-devel/2011-July/000251.html

was to swap the default gui from xwrt to luci. Good, in that that GUI k= eeps getting better and better. Bad, because neither jim, nor I, know lua t= he language at all, and can't add features nor fix gui issues.

I've learned=A0 a lot of languages in my life, but can write shell and = C and SQL in my sleep. In olden days I could count LISP among those, too, a= nd a dozen others, but not of late.

Recently I shot myself in the fo= ot, trying to scale kleinrock up and down by doing a simple lookup table fo= r 'sqrt' for various amounts of flows in the various AQM attempts I= have going using 'tc' in the deBloat.git repo. The numbers were so= off from correct, that I realized that I really needed to take a sqrt dire= ctly...

and the only way to do that (or so I thought) was to write a shell scri= pt wrapper around 'bc'...

and to get bc, I needed to compile= and install it on cerowrt.

Not only that, but the shell script was = horribly slow, taking 2 minutes in one version, to create the tc rules. I r= ewrote it in C, cutting that time down to 6 ms (and getting my !@! sqrt fun= ction for free), but that lacks the run time flexibility of an interpreter.=

Then I realized that lua could do the job...

lua -e "print(= math.sqrt(12))"

and then I realized, why not try writing the AQ= M stuff entirely in lua and see if I got a good compromise between shell an= d C.

and finally be able to do gui stuff, eventually.

It's an odd= way to bite the bullet and decide to try to learn a new language, but, the= re it is.
<= /blockquote>

translated the c into lua (t minus whenever I sent this message)
time ./htb-bt-qfq-red-4mbit > /dev/null

real=A0=A0=A0 0m1.7= 62s
user=A0=A0=A0 0m0.180s
sys=A0=A0=A0 0m0.330s

d@cruithne:~/= git/deBloat/src$ time ./a.out > /dev/null

real=A0=A0=A0 0m0.025s
user=A0=A0=A0 0m0.020s
sys=A0=A0=A0 0m0.000s

d@cruithne:~/git/deBloat/src$ time ./test.lua = > /dev/null

real=A0=A0=A0 0m0.090s
user=A0=A0=A0 0m0.083s
s= ys=A0=A0=A0 0m0.007s

Moving to lua, I think, is wise.

=A0
=


--
Dave T=E4htSKYPE: davetaht
US Tel: 1-239-829-5608
FR Tel: 0638645374
http://www.bufferbloat.net



--
Dave T=E4= ht
SKYPE: davetaht
US Tel: 1-239-829-5608
FR Tel: 0638645374
http://www.bufferblo= at.net
--14dae9341101a84bab04b4011b93--