Search Issue Tracker

By Design

Votes

1

Found in

2018.4

2019.3.7f1

2020.2

Issue ID

1254116

Regression

No

[IL2CPP][Android] Calling DateTime.now for the first time when using IL2CPP is CPU intensive(takes from 200 to 500 ms)

IL2CPP

-

Steps to reproduce:
1. Open user attached project "DateTimeNowUnityProject.zip"
2. Build it on Android with Autoconnect profiler option enabled
3. Run the profiler right before opening the app
4. Stop Recording the profiler
5. In the Profiler Analyzer press "Pull Data"
6. In the top analyzer field, select the second intensive frame
7. In the search bar type "Date"
8. In the "Marker Details for the currently selected range" find "Assembly-CSharo.dll!::TestDateTimeNow.Start()..." (this line should be on the top)
9. Notice it takes a lot of time to load (from 200 to 500 ms)

Expected results: Calling DateTime.now for the first time is not CPU intensive
Actual results: Calling DateTime.now for the first time is CPU intensive making load time anywhere from 200 to 500 ms

Reproducible with: 2018.4.23f1, 2019.3.16f1, 2019.4.0f1, 2020.1.0b13, 2020.2.0a15
VLNQA00220, Samsung Galaxy Note9 (SM-N960F), Android 8.1.0, CPU: Exynos 9 Series 9810, GPU: Mali-G72
VLNQA00123, Google Pixel 2 XL (Pixel 2 XL), Android R, CPU: Snapdragon 835 MSM8998, GPU: Adreno (TM) 540

Note:
- Reproduction steps are displayed with screenshots
- Does not reproduce with standalone
- Does not reproduce with mono scripting backend

  1. Resolution Note (2020.2.X):

    Closing the same way as the duplicate.
    Tried on two devices at hand and Asus ROG Phone it took 132 ms, while it took ~500 MS on iPhone 6S, so it seems the difference is device specific, not platform specific.

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.