16
Nov 08

Codebits 2008

Path: mv.asterisco.pt!mvalente
From: mvale…@ruido-visual.pt (Mario Valente)
Newsgroups: mv
Subject: Codebits 2008
Date: Sun, 16 Nov 08 22:03:21 GMT

Another Codebits has gone by. Its always some nice time
off from your standard daily life, but age is starting to
get to me. Like Savatage says: “And though we still stay
up all night, the mornings arent quite as bright”. Plus
the novelty is starting to wear off and I dont find it as
interesting anymore. Add to that the fact that beyond a
certain point you just start to look ridiculous, like those
parents who go with their kids to nightclubs, and the fact
that it becomes pretty obvious that the kids really dont feel
comfortable with you being there. Its very likely that I wont
be there next year…

Anyway, once again a nice hacking/programming contest. The
number of bozos, clowns and wannabes has gone up but the jury
was able to go through 81 projects and find a few valuable ones.

Out of all of them, some definitely stand out, although they’re
not “investment” grade:

– Project 2 (the “Quiz Show” setup, using hacked Buzz controllers)
and Project 20 (the winner, code and demo for using the Open Moko
accelerometer) deserve major kudos for hack value. I wouldnt
invest in them though.

– Project 43 (“Million Dollar World”, a selling pixel space in a
world map project cloning the Million Dollar Page 1×1 pixel
ad space sellout) and Project 58 (“FotoLOL”, a mashup of random
fotos and random post titles that generates some funny situations)
have some money-making value, but always dependent on ad based
revenue and not much of a business model. I definitely wouldnt
invest in them but their authors should go forward with the
implementation, before someone else does it. Hell *I* would clone
the “Million Dollar World” this week, if it wasnt for the fact
that I have some principles (unlike others who feed on others
ideas and dont even credit them back)

The ones that stood out where I would think about putting money
in (after discussing several issues, including business model):

– Project 1, “Na Taxa Verde”, from Codebits07 winners, has some
potential. Its basically an invoice tracker for freelancers that
could get some traction and income with aditional features (like
expense tracking and tax advisory)

– Project 12, “FeedBits”, is a feedreader which includes a
Bayesian filter. Lots of talk around something like this and even
similar projects, but nothing that really does it well. Could solve
a personal itch of mine and could even sell some copies (maybe
through the iphone/android app markets, at a small price)

– Project 13, “GoodActions”, is sort of a social network for
do-gooders to track their nice deeds and to get suggestions. It
has enough “touchy feely”, “new age”, “social responsibility”
involved that might just make it gain a following within the
socialist vegetarian animal lover crowd. Not my sorta people but
hey… as long as they have money to spend (and it seems they
are the upcoming psychosocial segment) I’m with it bro…

– Project 33, “World Wide Apps”, is from a friend of mine that
wants every site to be wikipedia-like and have both content *and*
source code editable. Its wacky enough to interest a fringe of
users (and companies… yum) and to generate its own plataform and
ecosystem. Curiously enough a few hours later after discussing the
project and seeing it presented I found out something very much
like it implemented in serverside Javascript, no less (SSJS is a
personal fave right now). See http://reasonablysmart.com/

– Project 70, “Sapo Quest”, is a set of quest/games/challenges
to be done in real life by completing a set of steps or stages
while being tracked (using RFID at Codebits). The idea could very
well have some nice applications for alternate reality games
(which are played using your real environment), namely by using
other types of tracking (GPS, mobile). I have some business model
ideas around thus type of alternate reality game that dont
involve your typical game and gamer that could generate some nice
cash flows.

All in all, I hope that Codebits happens again next year. A big
thumbs up for Celso and for all the people at Sapo team that make
Codebits happen. Maybe someday the portuguese web community will
live up to your standards and deserve all the personal sacrifices.

I’m sad to say
It’s time to go
But until we meet again along the road
Remember this, on your journey home
When you hear the thunder roar, you’re not alone
We wish you well
We wish you well
In times of trouble, may your heart be strong
We wish you well
We wish you well
Until we meet again
We wish you well
– Whitesnake, “We Wish You Well”

— MV


27
Sep 08

Golden Oldies

Path: mv.asterisco.pt!mvalente
From: mvale…@ruido-visual.pt (Mario Valente)
Newsgroups: mv
Subject: Golden Oldies
Date: Sat, 27 Sep 08 19:31:21 GMT

A long, long time ago, around 1978, I started listening
to music. My first memories of music is stuff like Patrick
Hernandez Born to be Alive, Boomtown Rats Tell Me Why I Dont
Like Mondays, Pink Floyds The Wall and Kiss I Was Made for
Loving You.

But the very very very first set of records that I listened
to was a Readers Digest box set, bought by my parents, called
the Golden Hit Parade:

http://www.discogs.com/release/991081

Lots of good stuff in the playlists, true classics, one
hit wonders and standard top 40 fare. But, amidst it all,
my favourites were the “weird” songs, stuff that you have
probably never heard about and, if you hear it, might not
want to hear ever again :-)

So here’s some wacko songs that I still find great fun
to listen to…

Lord Rockingham’s XI – Hoots Mon
http://www.youtube.com/watch?v=Z7Ymov6JhRE

The Marcels – Blue Moon
http://www.youtube.com/watch?v=bJavHuHAjgY

Jimmy Dean – Big Bad John
http://www.youtube.com/watch?v=mR9dDdUmdtU

The Sweet – Ballroom Blitz
http://www.youtube.com/watch?v=ZrBDivsSe3k

Focus – Sylvia
http://www.youtube.com/watch?v=4V26-oscwDU

Heinz – Just like EDDIE
http://www.youtube.com/watch?v=hqRLR-EtlEk

Jet Harris and Tony Meehan– Diamonds
http://www.youtube.com/watch?v=XZbfzm6voVk

Yep, I AM a geezer, I’ll nick ya…

— MV


27
Aug 08

Serverside Javascript Tracemonkey Performance – Part V

Path: mv.asterisco.pt!mvalente
From: mvale…@ruido-visual.pt (Mario Valente)
Newsgroups: mv
Subject: Serverside Javascript Tracemonkey Performance – Part V
Date: Wed, 27 Aug 08 01:50:21 GMT

Finally had some time free to run the Sunspider tests on
serverside Javascript 1.6 and JS1.8tracemonkey. The results are
listed below.

http://svn.webkit.org/repository/webkit/trunk/SunSpider/tests/

Performance wise there’s not much of notice. Results are
basically in line with Brendan Eich’s results for browserside
tests.

http://weblogs.mozillazine.org/roadmap/archives/2008/08/tracemonkey_javascript_lightsp.html

One thing is of notice though: JS1.8 throws a segfault in
at least 5 of the tests. I dont have much time to debug right
now, but a strace shows that the last system call was a call
to gettimeofday, after a bunch of read()s containing js source
code lines. Maybe a call to date functions… or the fact that
I patched and compiled in the not-recomended jsfile.c File object
support ;-)… Will have to look into it later…

—————————————
3d-cube.js
JS 1.6
real 0.59
user 0.55
sys 0.01

JS 1.8
real 0.08
user 0.06
sys 0.01
—————————————
3d-morph.js
JS 1.6
real 0.69
user 0.61
sys 0.04

JS 1.8
real 0.06
user 0.04
sys 0.02
—————————————
3d-raytrace.js
JS 1.6
real 0.47
user 0.41
sys 0.02

JS 1.8
./perftest: line 1: 13589 Segmentation fault js18 -j $f
real 0.01
user 0.01
sys 0.00
—————————————
access-binary-trees.js
JS 1.6
real 0.27
user 0.22
sys 0.03

JS 1.8
real 0.10
user 0.08
sys 0.01
—————————————
access-fannkuch.js
JS 1.6
real 0.97
user 0.93
sys 0.00

JS 1.8
./perftest: line 1: 13593 Segmentation fault js18 -j $f
real 0.03
user 0.02
sys 0.00
—————————————
access-nbody.js
JS 1.6
real 0.60
user 0.44
sys 0.06

JS 1.8
real 0.07
user 0.05
sys 0.01
—————————————
access-nsieve.js
JS 1.6
real 0.56
user 0.50
sys 0.00

JS 1.8
real 0.03
user 0.03
sys 0.01
—————————————
bitops-3bit-bits-in-byte.js
JS 1.6
real 0.26
user 0.26
sys 0.00

JS 1.8
real 0.00
user 0.00
sys 0.00
—————————————
bitops-bits-in-byte.js
JS 1.6
real 0.40
user 0.38
sys 0.00

JS 1.8
real 0.01
user 0.01
sys 0.00
—————————————
bitops-bitwise-and.js
JS 1.6
real 0.34
user 0.29
sys 0.00

JS 1.8
real 0.03
user 0.01
sys 0.01
—————————————
bitops-nsieve-bits.js
JS 1.6
real 0.66
user 0.56
sys 0.00

JS 1.8
real 0.04
user 0.00
sys 0.00
—————————————
controlflow-recursive.js
JS 1.6
real 0.14
user 0.12
sys 0.00

JS 1.8
real 0.07
user 0.07
sys 0.00
—————————————
crypto-aes.js
JS 1.6
real 0.46
user 0.32
sys 0.04

JS 1.8
./perftest: line 1: 13609 Segmentation fault js18 -j $f
real 0.01
user 0.00
sys 0.00
—————————————
crypto-md5.js
JS 1.6
real 0.38
user 0.27
sys 0.01

JS 1.8
./perftest: line 1: 13611 Segmentation fault js18 -j $f
real 0.02
user 0.02
sys 0.00
—————————————
crypto-sha1.js
JS 1.6
real 0.35
user 0.25
sys 0.01

JS 1.8
real 0.02
user 0.02
sys 0.00
—————————————
date-format-tofte.js
JS 1.6
real 1.03
user 0.69
sys 0.09

JS 1.8
./perftest: line 1: 13615 Segmentation fault js18 -j $f
real 0.08
user 0.07
sys 0.00
—————————————
date-format-xparb.js
JS 1.6
real 1.74
user 1.37
sys 0.17

JS 1.8
real 0.19
user 0.15
sys 0.02
—————————————
math-cordic.js
JS 1.6
real 0.63
user 0.51
sys 0.00

JS 1.8
real 0.05
user 0.04
sys 0.00
—————————————
math-partial-sums.js
JS 1.6
real 0.42
user 0.36
sys 0.02

JS 1.8
real 0.03
user 0.03
sys 0.00
—————————————
math-spectral-norm.js
JS 1.6
real 0.28
user 0.21
sys 0.04

JS 1.8
real 0.02
user 0.01
sys 0.00
—————————————
regexp-dna.js
JS 1.6
real 0.60
user 0.50
sys 0.05

JS 1.8
real 0.37
user 0.33
sys 0.01
—————————————
string-base64.js
JS 1.6
real 1.10
user 0.94
sys 0.07

JS 1.8
real 0.03
user 0.01
sys 0.02
—————————————
string-fasta.js
JS 1.6
real 0.77
user 0.66
sys 0.05

JS 1.8
real 0.23
user 0.20
sys 0.02
—————————————
string-tagcloud.js
JS 1.6
real 0.63
user 0.58
sys 0.00

JS 1.8
real 0.23
user 0.19
sys 0.02
—————————————
string-unpack-code.js
JS 1.6
real 0.54
user 0.48
sys 0.01

JS 1.8
real 0.33
user 0.28
sys 0.04
—————————————
string-validate-input.js
JS 1.6
real 0.43
user 0.35
sys 0.04

JS 1.8
real 0.10
user 0.07
sys 0.02

— MV


25
Aug 08

Serverside Javascript Tracemonkey Performance – Part IV

Path: mv.asterisco.pt!mvalente
From: mvale…@ruido-visual.pt (Mario Valente)
Newsgroups: mv
Subject: Serverside Javascript Tracemonkey Performance – Part IV
Date: Mon, 25 Aug 08 02:06:21 GMT

Before starting in on the Dromaeo and Sunspider tests, I decided
to run some tests to compare JS1.8tracemonkey with other languages.

For C, I created a couple of tests similar to Mike Shaver’s simple loop
but using instead the loop-sum and the function-sum tests from Sunspider
ubench tests.

http://shaver.off.net/diary/2008/08/22/the-birth-of-a-faster-monkey/

As you can see from the output below, JS1.8tracemonkey only comes close
to unoptimized gcc in a simple for loop. If the loop contains some
statements, as is the case, Tracemonkey is slower 2x/3x than compiled C.

To compare with other languages, I also created a direct copy of Tim Bray’s
Ruby code for his Wide Finder project, but with dismal results. My script clocks
in at nearly 5 secs using his o10k.ap 2Mb file sample (which would mean >500secs
with the o1000k.ap 200Mb file).

http://www.tbray.org/ongoing/When/200x/2007/09/20/Wide-Finder
http://mv.asterisco.pt/Projects/wf1.js

It seems that the only language missing an entry in the Wide Finder challenge
is Javascript. I believe that the only reason for that is that people
just arent used to use Javascript to perform these type of tasks, due to the
misconception that “its for the browser and you cant access files”. I’m
curious to find out if with JS1.8tracemonkey we can get similar performance
to the other languages/contestants…

Tomorrow I hope to try and reproduce Santiago Gala’s and Fredrik Lundh
techniques and have a script that is more in line with the general results
for other languagues (meaning a ballpark 5-8 seconds for the 200Mb sample
or 50-80ms for the 2Mb sample). Or someone more versed in generators,
iterators, map/reduce and all that shiny new stuff might be kind enough
to send in the script :-)…

http://effbot.org/zone/wide-finder.htm
http://www.tbray.org/ongoing/When/200x/2007/10/30/WF-Results

—————————————-

[root@localhost perfjsvsc]# cat loop-sum.js; js18 -j loop-sum.js; time -p js18 -j loop-sum.js
var count = 99999999;
var sum = 0;
for (var i = 0; i < count; i++) {
sum = i + count;
}

real 0.84
user 0.19
sys 0.00

—-

[root@localhost perfjsvsc]# cat loop-sum.c; gcc -o loop-sum loop-sum.c; ./loop-sum; time -p ./loop-sum
int count = 99999999;
int i, sum = 0;

main()
{
for (i = 0; i < count; i++)
{
sum = i + count;
}
}
real 0.39
user 0.09
sys 0.00

—-

[root@localhost perfjsvsc]# cat function-sum.js; js18 -j function-sum.js; time -p js18 -j function-sum.js
function f(x, y, z)
{
return x + y + z;
}

for (var i = 0; i < 99999999; ++i)
f(1, 2, 3);

real 1.76
user 0.41
sys 0.00

—-

[root@localhost perfjsvsc]# cat function-sum.c; gcc -o function-sum function-sum.c; ./function-sum; time -p ./function-sum
int f(int x, int y, int z)
{
return x + y + z;
}

main()
{
int i;

for (i = 0; i < 99999999; ++i)
f(1, 2, 3);
}

real 0.69
user 0.17
sys 0.00

—————————————-

— MV


24
Aug 08

Serverside Javascript Tracemonkey Performance – Part III

Path: mv.asterisco.pt!mvalente
From: mvale…@ruido-visual.pt (Mario Valente)
Newsgroups: mv
Subject: Serverside Javascript Tracemonkey Performance – Part III
Date: Sun, 24 Aug 08 19:01:21 GMT

As expected the Sunspider ubench Javascript performance tests
on serverside JS 1.6 and JS 1.8 (tracemonkey) run much faster
when on a halfway decent machine. Below you can find the tests
when running on a Xen VM (underlying hardware is some kind of
quad-core machine).

In this case JS1.6 now takes 9.940ms to complete all tests
(a small decrease from the 11s on the UML VM and about double
the 4.1982ms of the browserside testes) while JS1.8tracemonkey
now takes 0.300ms (halving the previous serverside tests at the
UML VM and coming close to the 185ms on the browserside tests.
Huge difference, now around a +-30X increase!

If someone wants to and can run these tests in a bare metal
Linux machine and needs the files, let me know. The browserside
tests made by Brendan Eich dont mention the hardware used to run
the tests but I would like to see some serverside tests in a
decent machine which I’m sure would beat the browserside times.

[root@localhost ubench]# cat ubench.out
—————————————
function-closure.js
JS 1.6

real 0m0.399s
user 0m0.340s
sys 0m0.030s

JS 1.8

real 0m0.011s
user 0m0.000s
sys 0m0.010s
—————————————
function-empty.js
JS 1.6

real 0m1.869s
user 0m1.760s
sys 0m0.000s

JS 1.8

real 0m0.065s
user 0m0.040s
sys 0m0.000s
—————————————
function-missing-args.js
JS 1.6

real 0m1.609s
user 0m1.600s
sys 0m0.000s

JS 1.8

real 0m0.047s
user 0m0.040s
sys 0m0.000s
—————————————
function-sum.js
JS 1.6

real 0m1.769s
user 0m1.620s
sys 0m0.000s

JS 1.8

real 0m0.048s
user 0m0.040s
sys 0m0.000s
—————————————
loop-empty-resolve.js
JS 1.6

real 0m0.392s
user 0m0.350s
sys 0m0.000s

JS 1.8

real 0m0.027s
user 0m0.020s
sys 0m0.000s
—————————————
loop-empty.js
JS 1.6

real 0m1.865s
user 0m1.820s
sys 0m0.000s

JS 1.8

real 0m0.050s
user 0m0.040s
sys 0m0.000s
—————————————
loop-sum.js
JS 1.6

real 0m2.027s
user 0m1.950s
sys 0m0.010s

JS 1.8

real 0m0.052s
user 0m0.050s
sys 0m0.000s

— MV