84% frame drop when logging with console open

Issue #206 open
Patrick Wyatt created an issue

When the console is open, and after several hundred messages have been logged, when new log messages are added the framerate drops by 84% (120 FPS → 20 FPS) in V2.6.6.

The issue seems to be that TextMesh Pro must render the entire multi-line block of 1024 lines after each call to QuantumConsole.FlushToConsoleText. Perhaps a ScrollView that only renders lines that are visible in the view – rendering _logStorage.Logs instead of _logStorage.GetLogString would work better?

Comments (2)

  1. Patrick Wyatt reporter

    Script to generate logging “noise”:

    using UnityEngine;
    using System.Collections;
    
    public class LogFrequently : MonoBehaviour {
        private void Awake () {
            _ = StartCoroutine(LogFrequentlyCoroutine());
        }
    
        private IEnumerator LogFrequentlyCoroutine () {
            for (int frame = 0; ; ++frame) {
                Debug.Log($"frame {frame}");
                yield return 1;
            }
        }
    }
    

  2. Log in to comment