help with reducing cpu usage

i have a problem with my script. when i run the game, my gamescript Update() is using a lot of cpu. i tried to reduce it a bit with some methodes but still a lot of cpu.

as you guys saw i have an online free database and the database works perfect but it uses a lot of cpu. i tried a methode that Update() only update every second but than you will see every second that some frames freezes. i really dont know how to reduce the gpu usage from my Update() in my gamescript while my script is still working. what this script does = getting data from the database, sums up those data to a total score. and than show the score in a textlabel.(btw i also have a script that is when i get a point it inserts it to the database(thats why i want it in update so the totalscore/highscore will stay updated)).
i hope you guys can help me with reducing the script cpu usage or a better methode so i dont have fps lag. thanks in advance.

I am noob about network, but if you are accessing it every frame, it will consume more network data isn’t it? So update will cost a lot of network and cpu

  • I think you should get the online total score only on some circumstances like:
  • the game starts/ match starts/ on Game over/ on accessing leaderboard/ on game quit
  • Or run that in every 10 frames or fixed update