How to: Speed up GMod in singleplayer

Some people are aware of this, some don’t.

Everyone knows: you are building an awesome contraption. When its finished, you unfreeze it and your framerate drops horribly and it starts to lag.

“But i have an i7 quad core with 8 Gb RAM and a 500 bucks gfx card!!??”

This is why: Garry’s Mod only uses 1 core of your CPU. That is quite a shame, if you have a quad or even an octo (8) core processor. It will never use your full CPU power, it just picks a core randomly and use it.

For people that dont really understand i am talking about, here is an analogy:
You are hungry and ordered a pizza. You slice it in 4 pieces and eat one piece. Although you are still very hungry, you throw the other 3 slices in the trash bin.

Anyways, how do we make garry’s mod use all your cores? We can’t. Well there launch command lines you can use, but it is very unstable and gmod will most likely crash.

So how do we work around this?

We set up a Dedicated Server. How to do it? Follow this tutorial:

Once you have setup the sever, you will have to join it via garry’s mod. Do this by typing this in console: connect 192.168.X.XXX:27015 where the x’s are being replaced by your machines IP number. 27015 is the default port, but may be diffrent depending on your settings. This is in a LAN. If you are not in a lan: connect

Valve’s dedicated server software uses all the cores of a CPU. This means basicly that your large contraptions won’t start lagging due to the amount of props. This is because the physics engine will be running on the server software instead of the client.

The only disadvantage you will have is Latency. It will be around 1 to max 10.

Anyways, i hope i contributed with this post. Please don’t ask questions about how to setup a server here, please go to the appropiate forum for that.

And some of us might also be aware that the 2007 update added Multiple core support.


Games such as half life indeed. Not Garry’s Mod.


Here’s a box for your post.
GMod has no support for multiple cores because of Lua.


I’m pretty sure it can’t. It can run on a different core to your Garry’s Mod instance however which would be how you get your performance increase.

I tested it extensively with a CPU monitor.

Besides, try it in-game. I build mainly trains in gmod, and it always starts to lag when i have more than 2 coaches. Now i can add 6 more coaches without having any lag.

Also, it would be kinda stupid not to support multi-core on dedicated server software, wouldn’t it?
That would suck in 32 slot multiplayer games.

I understand your reaction, for i believe that they added multicore support only in 2007. Not sure though, but they did.

I wonder if garry could implement this sort of thing for singleplayer in garrysmod; Physics is calculated by multiple cores whilst LUA keeps running on one. Is that possible?

From what i have read, the only way to make Garry’s Mod work on more than one cpu core is too compile all of the lua files that will be running. Is this right? And if so how can it be done?

It is possible, but then it would require a Lua compiled file executor I think, GMod can’t run compiled lua files natively.

This will be useful for people unsure about setting up a dedicated server: