Benchmarking My FX-8320 with Core3 and TrinityCore in VirtualBox

One of the biggest disappoints I have had when it comes to computers was buying an early version of the Intel Core2 Quad Q8200, because Intel disabled their hardware virtualization support (VT-d) on it, as part of their arbitrary and consumer-unfriendly pricing scheme. That was back in 2008 and at $185, it was the best new CPU I could afford at the time. Certainly, it was better than the Pentium DualCore I was using!

When it came time to upgrade, I spent a long time researching all of my options for new hardware, so that I could not only get the best performance for my dollar, but so I could have access to all the features and functionality of a desktop. I really wanted to get into using virtual machines for something truly useful… something like modding a SWGEmu server (Core3)! I also wanted to get better performance in games, such as Planetside 2 and Guild Wars 2, but that was secondary.

This was fall 2013 and at that time, hands down the best deal was the AMD FX-8320 if you could catch on sale for $135 CAD or so (with the FX-6300 being the next best for the same price). Absolutely, a Core i7 3770 (non-K, because VT-d is was disabled on the K version…) would have been way better, but it was also $340 – $370 CAD, which was basically my whole upgrade budget. Obviously I couldn’t buy a CPU without a motherboard and RAM, so I waited until the FX-8320 went on sale and bought it. I’ve been nothing but pleased with it since – seriously, it’s a super computer!

I reused my Silverstone Heatsink/Fan tower, which is enough to keep the cpu around 45C while compiling with all 8 threads natively using gcc in Linux. It’s stock speed is 3.5GHz and it turbos up to 4.0GHz. I’ve played around with over clocking on it and it is most happy when sitting at 4.0GHz with turbo and power management options disabled. In Windows, it sits at 4GHz all the time and Linux it down clocks to 1.8GHz while idle. Letting it down clock in Windows causes noticeable performance issues while playing games and while compiling in a virtual machine, but Linux seems fine either way.

Usually I have a single VM open using VirtualBox, where I work using the Xfce desktop environment in my Debian 8 Linux guest, inside my Windows 10 host. This gives me the best of both worlds – all the GNU software I love, functioning pretty much the same as running it on the hardware directly, and all the Windows software I use (mostly DirectX based games) can take full advantage of my AMD R9 270 video card. As much as I appreciate the WINE project, honestly, Windows games work way better in Windows. A lot of GNU software on the other hand seems to work just fine in a virtual machine, which is awesome.

I like using VMs, because they are their own self contained systems that can share files with the host system and with each other, without messing each other up. For instance, while I could build TrinityCore directly in Windows and get a decent performance boost while compiling, it would also mean I would need to have a MySQL database running in the background too and… I don’t want that running all the time. Yes, I could put just the MySQL DB in a VM, but… you know what, I prefer working in Linux anyway, so it’s just better to have the whole thing as one self contained “work environment”. So that’s what I have, a VM for Legend of Hondo, a VM for helping with the Tarkin 2.0 server, and a VM for Solozeroth (TrinityCore). And some other ones, such as old timey Slackware, just because!

Anyhow, with all that background out of the way, here is what compiling Core3 and TrinityCore looks like on my machine!

Host System
AMD FX-8320 (Locked at 4.0GHz with Turbo disabled)
8GB DDR3 2133 RAM (2x 4GB)
SK Hynix SL300 250GB SATA3 SSD
Windows 10 64Bit Build 15063.138
VirtualBox 5.1.20

Core3 Environment
Debian 8.5
Linux kernel 3.16.0-4-amd64
GCC 4.9.2
Core3 (SWGEmu) 2016.10.06

TrinityCore Environment
Debian 8.7
Linux kernel 3.16.0-4-amd64
GCC 4.9.2
TrinityCore 3.3.5 2017.04.22
A chart goes here...
As you can see there, TrinityCore takes a hell of a lot longer to compile from scratch that Core3! It also uses more RAM on average and has a much higher peak RAM usage as well. Apart from that, both projects appear to scale similarly when they have access to more threads.

I should note that the 8 cores on my FX-8320, as far as gcc compiling goes, are indeed a 8 physical pieces of hardware handling one job each, unlike an Intel i7, which would be 4 physical pieces of hardware doing two jobs each. For floating point math operations, my FX-8320 only has 4 physical lumps of hardware that can only handle 4 jobs, unlike an Intel i7, which could handle 8 floating point math jobs. Thankfully the gcc compiler uses the “integer units”, of which I have 8! So with that said, if you have an FX processor and you’re working with gcc, you can safely ignore the warning in VirtualBox about assigning more CPU cores than you really have – crank it to the max and make sure you have enough RAM!

My problem is, 8GB of RAM isn’t really enough for compiling with 8 cores AND running the game in the host system. So, I tend to leave the VMs at 6 cores with 3.5GB RAM, which leaves plenty of RAM for working in both the host and the guest (running the server while playing the game, for instance – which works great btw!). Yes, that does mean that the computer takes long to compile, but nice part is that much of the time I don’t need recompile the entire projects. So in reality, most of the time the difference is more like shaving off 10 seconds from a 40 second compilation, which isn’t worth worry about.

Knocking 10 minutes off that 30 minute compile of TrinityCore might be worth the 30 seconds it takes to shutdown, move the RAM slider, and boot up though. Unless it’s lunch time or “AFK for hours on end, because distractions!” time…

On a related note, I have been thinking lately that it would be interesting to see how this compares to compiling on the same setup using a new AMD Ryzen processor or a recent Intel i5 or i7 processor. I’ve read several benchmarks/reviews, including this Linux gcc compiling related test on XDA, and it’s safe to say that yup, when you spend more money, you get a better processor!

Unfortunately, for the $135 CAD that I spent for my FX-8320 3.5 years ago, it’s still the best option for my work load in its price range. I was hoping the new 4 core, 8 thread Ryzen R5 1400 would be priced around $165 CAD, but it’s $225. The 8 core FX-8300 (a slightly lower clocked, but still fully unlocked, FX-8320) at $145 is only $15 more than the 6 core FX-6300 and honestly it’s a steal for Linux programming and VM work (which is basically the best case scenario for the Bulldozer/Piledriver based CPUs, as their 8 real hardware ALUs are great, but their 4 real hardware FPUs, slow cache, and crowded input pipeline are not so hot for stuff like playing games, music encoding, and some photo editing tools).

It’s kind of a bummer that today I can’t spend less to effectively double my performance, as I did when I made the jump to the $135 CAD FX-8320 from the $185 Core2 Q8200. I was overjoyed back then when my compile times in Rescue Girlies (based on Supertux 0.3.3, an SDL based project) were literally cut in half. That’s my kinda upgrade! Yeah, so anyway, I won’t be upgrading any time soon, because it doesn’t make sense to shell out $295 for the 6 core, 12 thread Ryzen R5 1600 (plus motherboard and RAM) that will almost double my performance. That kind of money would be better spent elsewhere, for all the difference it would actually make in my life! 🙂

When it comes time to upgrade, I am hoping that AMD will have a nice 4 core, 8 thread APU with 512 shaders for around $165. I don’t play any new games and an APU like that would give me a 15% to 25% boost in performance, while dramatically reducing the power usage of my desktop. Yes, it would have half the shaders of my R9 270, so I would probably have to dial back the graphics settings a bit but meh, my old eyes are getting blurry anyway! So we’ll see what 2018 or 2019 brings. Hopefully we’ll get some micro-ATX motherboards with 4GB GDDR6 Video RAM for the APUs, because that would be cool!

Advertisements

Core3 vs. TrinityCore – Which is better to work with?

KISS, that fun phrase every computer science teacher loves to share with his students, is the at the heart of this whole post; TrinityCore (a World of Warcraft server emulator) is a simple, straight forward C++/MySQL project, while Core3 (a Star Wars Galaxies server emulator) is about as “Mad Scientist” as one can get with programming. The difference is… well, it’s truly dumbfounding – so much so that I thought I would take some time to write about it.

If we go way back to my early 20s, I had a good laugh at my friend for playing Everquest, until he bought me a copy and it absorbed me into its oozing mass of unkempt humans and never ending flows of pretty text too. Man that game had a text message for everything!

You fart
You giggle
Kazantoopia runs away in disgust!
You take two steps
You take two more steps
You stop and look around

OK, maybe it wasn’t that bad, but it sure was game that had a funny way of drawing you into it and it basically made me give up single player games for more than a decade. Sure, I moved on from EQ to SWG and WoW (primarily), but I was always playing some kind of MMO. Of course, being a creative person who really wanted to be a part of the worlds I was visiting, I always wished that I could hop in there and make the tweaks and changes to the games that would make them perfect (for me!).

Luckily for me, after I had my fill of online interactions with an increasingly shitty community of people who play online games, I discovered that a bunch of folks far smarter than myself had built systems to emulate the servers of some of the MMOs I liked to play. I did play Star Wars Galaxies, on and off, until it shutdown in December of 2012, but after playing the Mist of Pandaria beta for World of Warcraft, I threw in my towel and walked away from WoW – Blizzard had simply taken a game that I liked and made it into a game that I no longer liked. Unfortunately, for the longest time I had a computer that wasn’t capable of running the 64Bit virtual machines used by these mysterious server emulators, so it took me until early 2014 to start puttering around with them. Since that time, I have learned way more about programming, GNU/Linux, client modding, and project management than I ever knew before and as a result, I have some worldly opinions about what is and isn’t fun work with.

I think the following summary really speaks for itself.

TrinityCore Requires:
– Windows or Linux
– A moden C++ compiler
– Some C++ standard libraries
– A MySQL database
– A text editor (or programming a IDE)

Core3 Requires:
– Linux 64Bit
– Specific versions of the gcc C++ compiler
– Some C++ standard libraries
– Knowledge of the included non-standard C++ libraries
– A whole other custom java program called Public Engine
– IDL compiler (automated C++ creator with its own syntax)
– Specific versions of Lua
– Specific versions of Java
– An understanding of custom C++ hooks for Lua that SWGEmu created
– A MySQL database
– An array of obfuscated Berkeley databases
– A text editor (or programming a IDE)
– A prayer that you don’t need to look something up, because the documentation usually doesn’t exist

I am by no means being harsh, nor am I being soft, that’s just the reality of the design philosophies of the two projects. As you can see from the requirements alone, TrinityCore is obviously easier to work with than Core3, but it gets better. Wait until you get a load of this!

Things that TrinityCore does/has that Core3 can’t do / doesn’t have:

– Excellent documentation.
– A massive list of commands built into the server’s command line.
– A help system that describes the function of all of those commands.
– The ability to use all those server commands on an admin account inside the game.
– Even more commands that can be used inside the game for damned near everything, from database lookups to moving characters from one account to another.
– A sensible relational database for all object and account data that can be manipulated with standardized tools.
– The ability to add new interactive content by simply adding new data to the database.
– C++ that’s “just plain old .cpp and .h files” lol…
– A preconfigured system designed to easily add custom C++ and database content.

And finally…

Things that really fucking suck about Core3 that aren’t an issue with TrinityCore:

– The documentation sucks. There’s not enough of it and what is there is disorganized and often out-dated.
– Client tools are required to look up some important information.
– Said client tools only work in Windows.
– The need to create/edit an arse load of Lua files to make even the most simple content.
– The lack of discipline and planning shown by the way previously completed content is frequently broken by new content and/or arbitrary changes to dependencies.
And my personal favourite:
– The development team has a history of being hostile in general, but their especially disinterested in discussing anything related to the creation of content beyond the scope of their desire to emulate SWG patch 14.1 (bugs and all…).

Now, I have nothing but respect for the good people who have spent thousands of hours building SWGEmu’s Core3 architecture and indeed, it’s better than anything I could put together on my own, but the plain truth of the matter is that in many ways, it’s really not fun to work with at all. When you add the convoluted nightmare of the client, modding SWGEmu quickly becomes a tedious quagmire of, well, stuff that feels more like boring work than fun hobby programming. On the hand, while I can’t say what it’s like to modify the WoW client, as I haven’t had the desire to do so, I can say that modifying the TrinityCore server is pretty much a dream come true.

I really enjoyed my time playing World of Warcraft during the Burning Crusade and Wrath of the Lich King. Now, thanks to TrinityCore, I have a fun little WotLK themed programming hobby, which I call “Solozeroth“, to play around with and learn from. And I must proclaim with utmost of joy and exuberance, puttering with TrinityCore is a genuinely fun way to practice and learn industry standard MySQL and C++!


PSA Soap Box Happy Hour:
Make sure you buy a copy of World of Warcraft or Star Wars Galaxies if you’re going to be working with either, eh. Having spent well over $1,000 on each over the years myself, funnelling my hard earned dollars into Blizzard and Sony Online Entertainment by purchasing game boxes, subscriptions, expansions, and services, I don’t feel bad at all for continuing to use my CD/DVDs of the games (especially given that it’s otherwise impossible to enjoy those versions of the games). Don’t be thieving arsehole, buy the games. 🙂