ICFP 2006

Jan 28, 2007 12:25

robhu pointed this out to me and, unfortunately, it's tripped my "ooh, that looks like fun!" mechanism... a series of puzzles trapped inside a block of data and a virtual machine spec ( Read more... )

icfp

Leave a comment

Comments 17

tentaclerodeo January 28 2007, 12:55:12 UTC
I am obliged by the ancient and honourable laws of INTERNET to say:

"Compsci compsci, mohammed jihad."

Reply

king_of_wrong January 28 2007, 13:38:51 UTC
Even if I'm doing it FOR SCIENCE!?

Reply

tentaclerodeo January 28 2007, 13:55:29 UTC
Doesn't make it any more comprehensible to normal people...

Reply

king_of_wrong January 28 2007, 14:06:30 UTC
Have added a link to the task in question, but... are you claiming to be "normal people"? ;)

Reply


ex_robhu January 28 2007, 14:28:20 UTC
I bow to your superior leet skills :-)

I'm writing a C# implementation now that should run at a reasonable speed. In the paper the contest creators published, their C# implementation was only twice as slow as their C implementation (which was 50% slower than the assembly implementation...)

When I've done the C# one I'm going to learn C and do a C one.

Reply

king_of_wrong January 28 2007, 15:00:13 UTC
C# should be reasonably fast, as Java would be if it were well suited to this task.

Anything hugely faster than a decent C/C++ implementation is unlikely, though... asm will gain a bit, as would JIT optimisation, but they're ridiculously expensive in terms of the associated gains (ie. 1000% more work for 20% more speed)

Reply

ex_robhu January 28 2007, 15:02:38 UTC
Apparently one of the fastest implementations was written in Lua! It was 3 times faster than your implementation ;-)

Reply

king_of_wrong January 28 2007, 15:13:37 UTC
*disbelieve*

Lua isn't at all suitable for such tasks, which is why emulator cores are written in asm (the "switch" operator in C/C++ doesn't compile too efficiently).

Of course, since all that we're able to compare is times, I could point out that this machine was built in early 2002... ;)

Reply


anonymous January 28 2007, 14:30:15 UTC
I ended up giving it a go, also after seeing RobHu's stuff about it. I started off in Haskell, before realising that I'm not good enough with the language, and the task is unsuited for it anyway, and switched to badly-written C++.

It then wasn't that hard, although it took me way longer than it should have to find a stupid operator precedence mistake that prevented loading from working. Sandmark in 2:25, far too much time wasted today playing with UMIX (so far, four logins stolen)

--Edwin

Reply

king_of_wrong January 28 2007, 15:03:10 UTC
Cool! I've got two passwords so far, and have a good idea where two more will come from.

Am not going to get into a measuring war w.r.t SANDmarks, though, since I'm within a factor of two of the fastest reported results and it seems to be fast enough :)

Reply

anonymous January 28 2007, 20:10:38 UTC
I didn't intend a measuring war (and even if I did, the difference between us is close enough that just posting times is meaningless).

I was quite surprised to see how much enabling optimisations helped, though. It took about 7mins without optimisations, and the 2:30 with -O3.

Reply

king_of_wrong January 28 2007, 22:33:49 UTC
Yeah, that's about what I'd expect for optimisations.

Depending on what the code's doing, it can be much slower on deallocation (e.g. VC will do integrity checks on the heap every time free() is called when in a debug build), but a factor of 2-3 is about normal for naive vs optimised integer ops.

Reply


Leave a comment

Up