I decided to take a look at the LIGHT and VIS source today and see what would be involved with getting them to work multithreaded. I knew that id had put the code in there for their Alpha machines but that it was disabled for everyone else. It turns out the code was almost fine for OSX except for some function names I had to fix up and a tiny bit of code refactoring.
But the end result is awesome! It works!
Some sample timings I took:
DM4
Before:
LIGHT = 1 second
VIS = 8 seconds
After:
LIGHT= 1 second
VIS = 5 seconds
Cool, but not really all that exciting right? Look at this:
START
Before:
LIGHT = 14 seconds
VIS = 49 seconds
After:
LIGHT = 7 seconds
VIS = 35 seconds
That’s a 50% speed up for LIGHT and a 29% speed up for VIS!
Another one:
E1M2
Before:
LIGHT = 25 seconds
VIS = 37 seconds
After:
LIGHT = 13 seconds
VIS = 25 seconds
About the same gains. So it looks fairly linear in nature. Awesome!
One thing to note here is that this is with 2 threads. I have code in the utilities to detect how many CPUs or Cores you have and it uses that number of threads. Using more than that number would be inefficient and using less would be silly. For example, I have a dual core processor so I get 2 threads. If you had one of those new 8 core monstrosities, you would get 8 threads! I would love to see some numbers on those machines.
At any rate, this will be in the 0.8 release of ToeTag which will be along pretty soon. I want to add a few more things before I call it a new version.
You’ll know when you have the multithreaded tools because your output log will have some new lines in it:
==========================================
LIGHT
==========================================
—– LightFaces —-
extra sampling enabled
74 entities read
Using multithreading (2 threads)
lightdatasize: 60932
0 switchable light styles
1.0 seconds elapsed
==========================================
VIS
==========================================
—- vis —-
testlevel = 4
661 portalleafs
1900 numportals
Using multithreading (2 threads)
average leafs visible: 157
c_chains: 3088511
visdatasize:27319 compressed from 54863
30.0 seconds elapsed
Soon!
EDIT: Interested in the source code for these utilities? Click here!