Search Unity

Bug: Performance with PKI Infrastructure

Discussion in 'Editor & General Support' started by BlakeSchreurs, Jan 26, 2021.

  1. BlakeSchreurs

    BlakeSchreurs

    Joined:
    Aug 10, 2016
    Posts:
    51
    Found a bug. A weird one. Not expecting an immediate resolution, but figured the devs would want to know. 100% reproducible. Tried to submit via the Unity bug reporter, but the bug reporter just says "Unable to write"

    Issue: Unity is extremely slow at startup. Instead of 4-7 seconds between Unity Hub and the splash screen, after clicking on a project in Unity Hub, the application would silently do ~something~ for 2-3 minutes with no splash screen, window, or other feedback (Only Task Manager or similar showed Unity loading). After that time, the Unity splash screen and loading bar would show, and the project would load as normal.

    On/Off VPN did not matter.
    Encrypted/unencrypted hard drive did not matter.
    Unity and project installed on a RAM drive did not matter.

    Unity version DID matter: Issue showed in 2019 and 2020, but was not present in 2018

    Uninstalling public key infrastructure (PKI) software resolves the issue. Reinstalling PKI brings the issue back. PKI application did not have to be running to cause the issue: It appears the Unity is using the registry (or a subsystem that uses the registry) and certificate data in the registry is sufficient to cause the issue.

    Our Public Key Infrastructure (PKI) software is used for signing e-mail and encrypting e-mail. We do not use this software for authentication/SSO.

    The issue does not seem to happen on Macs that have PKI software installed.

    Wireshark capture (with services closed) of network traffic for startup on personal machine was 166 KB.
    Wireshark capture (with services closed) of network traffic for startup on work machine was 3967 KB.
    Symptom: Unity appears to be generating, and waiting for, a huge amount of network traffic before the splash screen is shown.

    Turned off virus scanners and similar applications, and ran ProcMon to monitor process and determine behaviors. Unity 2018 ProcMon capture was 330 megabytes, Unity 2020 procmon capture was 1.2 gigabytes.


    Most notable difference between the two is that Unity2020 has a LOT of access to the PKI certificate cache and similar resources. Tens of thousands of lines of ProcMon capture related to accessing this certificate store (Maybe a nested loop?). Best guess is approximately 500,000 total entries related to the PKI cache.


    Our best guess is that Unity is noticing a lot of PKI certificates, and during startup is trying to do something with them over the web (hence the increased web traffic).