Jump to content

Another Performance Talk


gabberworld
  • Branch: Live Branch Version: Windows Pending

at inside game code "SimpleInfoScreen"

can you replace the Update() command  for something else like the ISim200ms or ISim100ms

there will be huge Performance increase for that specific Menu if you todo that.

or slow down the update command self with Time.deltaTime

example you can get here

https://docs.unity3d.com/ScriptReference/MonoBehaviour.Update.html

that would be probaply even better

 


Steps to Reproduce

SimpleInfoScreen.cs

  • Like 1



User Feedback


you  have at there also Sim1000ms and Sim4000ms

im not sure that you should use those commands because when you close menu. it still continue loop

maybe its somesort hidden performance bug. not sure yet why you have them there

---

guys i thing you have bug inside custom made timers. they not close self after you not need use them anymore.

even that RenderEveryTick  continue loop when you close that menu.

im debuging atm inside SimpleInfoScreen

Edited by gabberworld

Share this comment


Link to comment
Share on other sites

omg . guys dont use those custom made timers for menus what you made.

they increase speed when you increase the game speed.

trolllollloll

no wonder we have performance issues.

Share this comment


Link to comment
Share on other sites

soo i tested that update inside "SimpleInfoScreen"

this code should be fine,  tho this how it updates atm is totally wrong tho because it updates even when there is no changes at menu

    private float update;

    private void Update()
	{
		this.update += Time.fixedDeltaTime;
		if (this.update > 0.1f)  // updates every 100ms 
		{
			this.update = 0f;
			this.Refresh(false);
		}
	}
Edited by gabberworld

Share this comment


Link to comment
Share on other sites

guys. try avoid using the "foreach" as much as possible, that command does drop little code performance,

example inside "KAnimBatchManager" i changed at "UpdateDirty" command "foreach" to the "for" loop

and after that it increased the code speed

i tested that multi times for make sure that pc not trolling

Share this comment


Link to comment
Share on other sites

i guess you busy with other stuff soo i show how to increase performance

current code

	public int UpdateDirty(int frame)
	{
		if (!this.ready)
		{
			return 0;
		}
		this.dirtyBatchLastFrame = 0;
		foreach (BatchSet batchSet in this.activeBatchSets)
		{
			this.dirtyBatchLastFrame += batchSet.UpdateDirty(frame);
		}
		return this.dirtyBatchLastFrame;
	}

 

new code

	public int UpdateDirty(int frame)
	{
		if (!this.ready)
		{
			return 0;
		}
		this.dirtyBatchLastFrame = 0;
		for (int i = 0; i < this.activeBatchSets.Count; i++)
		{
			this.dirtyBatchLastFrame += this.activeBatchSets[i].UpdateDirty(frame);
		}
		return this.dirtyBatchLastFrame;
	}

 

  • Like 1

Share this comment


Link to comment
Share on other sites



Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
  • Create New...