Search Issue Tracker
Won't Fix
Votes
0
Found in
2021.3.33f1
2022.3.15f1
2023.2.4f1
2023.3.0a19
Issue ID
UUM-59222
Regression
No
Unity Purchasing initialize performance cost is too high when creating a StandardPurchasingModule
How to reproduce:
1. Open the “UnityPurchasingPerformance.zip” project
2. Open the “SampleScene”
3. Enter Play Mode
4. Press the "Test StandardPurchasingModule" a single time.
5. (Optional)
5.1 You can call "Test UDP Name" to see the milliseconds elapsed for the UDP.Name property alone to see that it is indeed the performance bottleneck.
5.2 You can call "Test Fix" to see a fixed version with the suggested code changes.
Expected result: “Standard Purchasing Module” creation time does not exceed 2-3 milliseconds
Actual result: “Standard Purchasing Module” creation time exceeds 20 milliseconds
Reproducible with: 2021.3.33f1, 2022.3.14f1, 2023.2.4f1, 2023.3.0a19
Reproducible on: Windows 10(by reporter), Windows 11
Not reproducible on: no other environment tested
Note:
- The user has provided a brief description of the issue and solutions:
”When calling UnityServices.InitializeAsync() as described in the documentation and when you profile the call it creates the StandardPurchasingModule instance. StandardPurchasingModule has a static dictionary with UDP.Name in it that blocks the calling thread (Main thread) because it uses reflection internally.
Expected behaviour: Calling an initialize method should not block for a considerable amount of time especially if we never target UDP.
This is relatively easy to fix by making this a static method with a switch case in it.”
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Texture2D hash changes inside of an AssetBundle when rebuilding a SpriteAtlas bundle with an empty AssetPostprocessor Script enabled
- Aniso Level still applies when Generate MipMap is disabled in Texture Import Settings
- Mipmap Limit Groups long names are not truncated when creating a new Mipmap Limit Group with a long name
- “ArgumentException: Invalid double parameter.” error is thrown when Infinity is typed into the Fixed Timestep field
- GameObject becomes gray when using HDRP and STP together on macOS
Resolution Note:
Deprecated in 5.0.0