dotnet / android

.NET for Android provides open-source bindings of the Android SDK for use with .NET managed languages such as C#
MIT License
1.93k stars 532 forks source link

fix: jit-times - Timestamp arithmetic + add warnings for negative times #9484

Open alexyakunin opened 2 weeks ago

alexyakunin commented 2 weeks ago
  1. Plus and minus operators for Timestamp type can produce invalid Timestamps. All of Timestamp parts should be either (0 or positive) or (0 or negative), but statements like result.milliseconds-- don't take this value into account in the next "if".

  2. The reporting there is broken - the tool parses methods.txt in assumption it is produced by a single-threaded app, and it seems that it's not the case in reality. That's why many "self" timings are negative.

  3. I truncate all negative self-times to zero while calculating total.

alexyakunin commented 2 weeks ago

@dotnet-policy-service agree

jonathanpeppers commented 2 weeks ago

/azp run

azure-pipelines[bot] commented 2 weeks ago
Azure Pipelines successfully started running 1 pipeline(s).
jonpryor commented 1 week ago

/azp run

azure-pipelines[bot] commented 1 week ago
Azure Pipelines successfully started running 1 pipeline(s).