Export to GitHub

google-highly-open-participation-psf - issue #248

Solve the first section (through section 3) of the ICFP '07 contest.


Posted on Dec 7, 2007 by Helpful Giraffe

See

http://www.icfpcontest.org/

and

http://morepypy.blogspot.com/2007/11/ropes-branch-merged.html

Solve through section 3 of the ICFP '07 contest.

Using either the CPython ropes implementation (see other task, if completed) or the PyPy ropes implementation (see morepypy blog post, above) compare performance of 'execute' on the entire genome with normal strings vs ropes data types.

Completion:

Upload Python code and benchmark results, and write a short post (blog size) on the results.

Task duration: please complete this task within 5 days (120 hours) of claiming it.

Comment #1

Posted on Dec 15, 2007 by Happy Horse

I claim this task.

This has got to be one of the coolest tasks - I've had my eye on it for a while, and I'm very surprised it's still open.

Comment #2

Posted on Dec 15, 2007 by Happy Bear

After all there are people who only go after easy money :)

Task is due December 20, 2007, 21:00 UTC.

Comment #3

Posted on Dec 15, 2007 by Happy Bear

(No comment was entered for this change.)

Comment #4

Posted on Dec 21, 2007 by Helpful Giraffe

Any progress? We can give you an extension, but ... we should hear back from you ;)

Comment #5

Posted on Dec 21, 2007 by Happy Horse

Sorry, I kinda dropped off the grid. I had a test in about every subject this week, so I haven't had time to finish it up. I should be able to finish it today or early tomorrow (since I'm out of school now), if that's all right.

Comment #6

Posted on Dec 22, 2007 by Helpful Giraffe

Sure, sounds good. Please just keep us apprised of your progress.

Comment #7

Posted on Dec 22, 2007 by Happy Horse

Ok, I think I have the code finished. Being an idiot, I failed to look at the pypy ropes implementation before I started coding, and instead assumed (wrongly) that it was class based (they'd have a class Rope, or something like it). It turns out that enabling ropes is best done as a runtime option on the pypy interpreter. This would be fine if I hadn't used a wrapper class, designed to work with either the standard strings, or the ropes. This change caused severe internal damage to my program.

Anyway, it works now, giving correct output for the (very limited) samples provided in the icfp specs. The code is certainly not as neat as it would be if I had read the full description before I started, but it works, and isn't that ugly. I'll post timing results as soon as I have them (H4wk.cz says his pypy took 7 hours - mine's still running). Sorry for the delay, and the ugliness.

PS - Titus, how's Caltech? It's one of the colleges I'm looking at for applications next year.

Attachments

Comment #8

Posted on Dec 22, 2007 by Happy Horse

Oops, I switched some names for the release, and broke it. This fixes it.

Attachments

Comment #9

Posted on Dec 22, 2007 by Massive Ox

Looks good to me.

I don't think it is necessary to execute the whole DNA for the benchmark. Just get the number of iteration per second and that will be fine.

P.S. Your implementation is fairly to mine, for which I had a good unit test suite. So if you want to test the correctness of your implementation, I am sure that my test suite could be modified to fit your implementation without much trouble.

Attachments

Comment #10

Posted on Dec 22, 2007 by Helpful Dog

looks good to me too (can I just set the status to completed or should only titus do that?). Of course running this on top of py.py as your README says is going to taken ages, so no use for waiting it to finish. Thanks for doing this, I will use it to benchmark and improve PyPy's ropes implementation.

Comment #11

Posted on Dec 22, 2007 by Helpful Dog

(No comment was entered for this change.)

Comment #12

Posted on Dec 22, 2007 by Happy Horse

Thanks, guys. I made a minor adjustment to have it time the first run loop, and got some surprising results. At least for the first iteration, the run times are almost the same - 43.13 seconds for CPython, and 43.40 for PyPy with ropes. I suppose the ropes make up for the PyPy overhead (FYI, using a 1.8 GHz PPC G5, single core). Anyway, thanks again, and happy holidays!

Comment #13

Posted on Dec 22, 2007 by Helpful Dog

Would you mind upload the modified version too?

Happy holidays to you too!

Comment #14

Posted on Dec 23, 2007 by Happy Horse

Sorry, forgot that. It's just a slight change in the DNA.execute function to support varying numbers of iterations.

Attachments

Status: Completed

Labels:
hard pypy ClaimedBy-chaos08 Due-20071220.2100