Cells port to C++

5 views
Skip to first unread message

Thomas McColgan

unread,
Jun 3, 2010, 5:27:54 PM6/3/10
to cells-g...@googlegroups.com
Pierre made a tentative port of cells to C++ with Qt. It can't run
python minds at the moment, but he is thinking about that, too. It's
very fast!

Have a look: http://github.com/elcerdo/cells

Once we have the features, gameplay and balancing figured out,
something like this would be a way forward, the performance benefits
would be huge, and it would allowing bots written in other languages a
lot more feasible.

Thomas

Scott Wolchok

unread,
Jun 3, 2010, 5:46:36 PM6/3/10
to cells-g...@googlegroups.com
On the other hand, speaking as someone who knows C++, C++ is a
nightmare and is very hard to write well, especially for new
developers. It also has a larger body of developers who don't know
what they're doing than does Python.

I would strongly suggest investigating the performance benefits
available with Cython before switching to C++. On the other hand, it
is unlikely that I will continue to have the amount of time to invest
in cells that I have had lately. (By the way, how much does Psyco help
vs. disabling it?)

-Scott

Thomas McColgan

unread,
Jun 3, 2010, 5:59:42 PM6/3/10
to cells-g...@googlegroups.com
On Thu, Jun 3, 2010 at 11:46 PM, Scott Wolchok <sc...@wolchok.org> wrote:
> On the other hand, speaking as someone who knows C++, C++ is a
> nightmare and is very hard to write well, especially for new
> developers. It also has a larger body of developers who don't know
> what they're doing than does Python.

I agree, Cython is also a good option. Then we can mix and match, only
doing the heavy duty functions in C/C++.

> (By the way, how much does Psyco help vs. disabling it?)

Psyco speedup is neglectible for me at the moment. It used to have
about a 2x speedup in early versions. Have you run anything with
cython yet? How big is the effect there?

Thomas

Scott Wolchok

unread,
Jun 3, 2010, 6:58:13 PM6/3/10
to cells-g...@googlegroups.com

The Cythonified function moves down considerably in the profile list,
but not to zero. Rewriting more of the core in Cython would help,
because Python function calls themselves are kind of slow, but Cython
functions can call each other in C and/or be inlined if things are
done appropriately. The agent code itself is also kind of a
bottleneck.

If the game semantics in terms of turn ordering are refined and the
rules come out nicely, it should be possible to parallelize the
evaluation of cells' actions. The desired constraints or lack thereof
on cell programs (particularly w.r.t. shared global state not using
the message queue) would be an important factor in any such
modification.

-Scott

Reply all
Reply to author
Forward
0 new messages