You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/advanced/performance-best-practices.md
+8Lines changed: 8 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,10 @@
2
2
3
3
This guide provides recommendations for optimizing test performance and ensuring your TUnit test suite runs efficiently.
4
4
5
+
:::performance
6
+
Want to see how fast TUnit can be? Check out the [performance benchmarks](/docs/benchmarks) showing real-world speed comparisons, or use the [benchmark calculator](/docs/benchmarks/calculator) to estimate potential time savings for your specific test suite.
7
+
:::
8
+
5
9
## Test Discovery Performance
6
10
7
11
### Use AOT Mode
@@ -15,6 +19,10 @@ TUnit's AOT (Ahead-of-Time) compilation mode provides the best performance for t
15
19
</PropertyGroup>
16
20
```
17
21
22
+
:::performance Native AOT Performance
23
+
TUnit with Native AOT compilation delivers exceptional speed improvements - benchmarks show **11.65x faster** execution compared to regular JIT. See the [AOT benchmarks](/docs/benchmarks) for detailed measurements.
Copy file name to clipboardExpand all lines: docs/docs/intro.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,3 +8,7 @@ It provides you a skeleton framework to write, execute and assert tests, with li
8
8
That means you get more control over your setup, execution, and style of tests.
9
9
10
10
It is also built on top of the newer Microsoft Testing Platform, which was rewritten to make .NET testing simpler and more extensible.
11
+
12
+
:::performance
13
+
TUnit is designed for speed. Through source generation and compile-time optimizations, TUnit significantly outperforms traditional testing frameworks. See the [performance benchmarks](/docs/benchmarks) or try the [benchmark calculator](/docs/benchmarks/calculator) to estimate time savings for your test suite.
Copy file name to clipboardExpand all lines: docs/docs/migration/mstest.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Migrating from MSTest
2
2
3
+
:::from-mstest Performance Boost
4
+
Migrating from MSTest to TUnit can significantly improve test execution speed. Benchmarks show TUnit is **1.3x faster** than MSTest on average. Check the [detailed benchmarks](/docs/benchmarks) to see performance comparisons.
Copy file name to clipboardExpand all lines: docs/docs/migration/nunit.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Migrating from NUnit
2
2
3
+
:::from-nunit Performance Boost
4
+
Migrating from NUnit to TUnit can significantly improve test execution speed. Benchmarks show TUnit is **1.2x faster** than NUnit on average. Check the [detailed benchmarks](/docs/benchmarks) to see performance comparisons.
Copy file name to clipboardExpand all lines: docs/docs/migration/xunit.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,9 @@
1
1
# Migrating from xUnit.net
2
2
3
+
:::from-xunit Performance Boost
4
+
Migrating from xUnit to TUnit can significantly improve test execution speed. Benchmarks show TUnit is **1.3x faster** than xUnit v3 on average. Check the [detailed benchmarks](/docs/benchmarks) to see performance comparisons.
Copy file name to clipboardExpand all lines: docs/docs/parallelism/not-in-parallel.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,10 @@
1
1
# Not in Parallel
2
2
3
-
By default, TUnit tests will run in parallel.
3
+
By default, TUnit tests will run in parallel.
4
+
5
+
:::performance
6
+
Parallel execution is a major contributor to TUnit's speed advantage. Running tests in parallel can dramatically reduce total test suite execution time. See the [performance benchmarks](/docs/benchmarks) for real-world performance data.
7
+
:::
4
8
5
9
To remove this behaviour, we can add a `[NotInParallel]` attribute to our test methods or classes.
The above will compile fine and run, but it will result in a failing test.
50
-
51
-
Because `MyTests` in `MyTest2` is different from `MyTests` in `MyTest1`, therefore the `_value` field is a different reference.
58
+
**Why this fails:** Each test gets a new instance of `MyTests`, so `_value` in `MyTest2` is a different field than in `MyTest1`.
52
59
53
-
If you really want to perform a test like the above, you can make your field static, and then that field will persist across any instance. The `static` keyword makes it clear to the user that data persists outside of instances.
0 commit comments