I'm doing some testing with some C # code and during an analysis I realized that some high peaking problems happen when whole-valued conversions to string occur, in most cases the conversion happens like this: classe.valor.ToString("0.0")
is there any way to improve this type of conversion? Using% w / w% the peak was even higher by reducing application performance. Would you have an alternative?
These conversions happen within a continuous function, which is updated every frame .
You can not post the whole code here, the values come from several classes so I'll post only a few snippets of one of the classes, so I can apply it to the other ones:
distancia.text = string.Concat(string.Format("{0:0.00}", distance.metros), " m");
if (contar)
{
i -= Time.deltaTime;
timeCount.text = i.ToString("0").Replace("0","Go");
if (i < 0)
{
contar = false;
}
}
checkpoint.text = string.Concat("Distance: ", string.Format("{0:0.00}", distance.metros), " m");
if (manager.count)
{
var valor = int.Parse(rota.metros.ToString("00"));
_menuManager.ShowMenu(Menu);
endPoints.text = string.Concat("distance: ", string.Format("{0:0.00}", rotaMaior.metros), " m");
}