voxnav/tyrant_optimize — pull request #1 by leftylink (2012-11-20 02:51:11+00:00)
Title: Split

I split up tyrant_optimize.cpp, as I discussed with voxnav privately.

The main things were moving XML-related file IO into a separate file (xml.{cpp,h}), moving non-XML-related file IO into another file (read.{cpp,h}), and moving simulation-related code into yet another file (sim.{cpp,h}). As a side-requirement of the first two, card and deck related things had to move to separate files as well (card.h, cards.{cpp,h}, deck.{cpp,h}). tyrant_optimize.cpp now mainly contains code to control optimization and multithreadedness.

I added a Makefile to ease compilation of the multiple files.

The downside of this is that compiling from scratch takes longer: On my netbook, it takes 150 seconds, up from 100.
The benefit is that compiling tyrant_optimize.cpp by itself takes 60, and sim.cpp by itself takes 30.
I think the improvement is good enough to be worth it.