Jump to content

Compiled C++ vs. Default Lua .exe


nick.ace
 Share

Recommended Posts

I'm running into a huge issue, I can't wrap my head around it. Whenever I compile the Lua interpreter (Visual Studio Express 2013, Release mode, Windows-32 bit), I get back an exe about 5.5 MB large. The Lua interpreter that comes in each project is only 4.5 MB large. This fact alone wouldn't be a huge issue, but I have a feeling that it is contributing to perfomance issues.

 

Here's the problem: If I create a map with too many entities, my compiled interpreter will exponentially decrease it's framerate until the game basically freezes. The same map used on the Lua interpreted version does not lead to that (the game runs fine at a constant framerate). I don't think it is a memory leak because if I remove instance of the same mesh, the problem goes away (which means it doesn't have to do with batches either, since that is constant).

 

I've even loaded the map without Lua scripts and I still get the same issue. It sounds like some sort of thrashing is going on due to less memory being allocated, but I'm not sure.

 

I'm also only using 2 lights, and about 120k polys (with a similar amount of shadowed polygons). I think I was using between 400 MB and 700 MB of VRAM, but none of these should be the issue here either as I have 2 GB or VRAM.

 

Anyway, any possible solutions or compiler settings/flags that I might be missing here?

Link to comment
Share on other sites

  • 4 weeks later...

I compared the engine project with a template and found the optimization settings were different:

Configuration Properties > C++ > Optimization

 

I also noticed the static library build is using a different optimization than the release EXE build. So that could explain the discrepancy. I will recompile with those changes and see what difference it makes.

  • Upvote 1

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

The static lib is now using the same optimization settings as the precompiled EXE. Will be interesting to see if that makes any difference.

My job is to make tools you love, with the features you want, and performance you can't live without.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...