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
Remove BenchmarkMemoryAllocation Test Due to Incompatibility
This commit removes the BenchmarkMemoryAllocation test from PerformanceBenchmarks.cs as it was found to be incompatible with the current testing setup. The removal aims to streamline the test suite and prevent unnecessary failures related to memory allocation measurements that do not align with the project's testing methodology. Additionally, minor updates were made to ensure consistency in test class imports across various test files.
Copy file name to clipboardExpand all lines: .cursor/rules/derived-cursor-rules.mdc
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -250,4 +250,9 @@ When adding XML documentation comments:
250
250
* **Frequency Validation:** Frequency values cannot be negative. Throw an `ArgumentException` if this condition is violated.
251
251
* **Divide by Zero Exception**: When dividing `SemanticQuantity` by zero, a `DivideByZeroException` must be thrown. This applies specifically to the `DivideToStorage` method when dividing two quantities of the same type.
252
252
* **Performance Benchmarks Memory Allocation:** Ensure memory usage in performance benchmarks remains reasonable (less than 10MB).
253
-
* **Performance Benchmarks Optimization:** In performance benchmarks, avoid excessive memory allocation by minimizing or eliminating `ToString()` calls within loops. Use the underlying values directly and prevent compiler optimizations by adding a check that utilizes the values.
253
+
* **Performance Benchmarks Optimization:** In performance benchmarks, avoid excessive memory allocation by minimizing or eliminating `ToString()` calls within loops. Use the underlying values directly and prevent compiler optimizations by adding a check that utilizes the values.
254
+
* **Performance Benchmarks Object Reuse:** In performance benchmarks, create objects outside the loop to reuse them, updating their values instead of creating new objects in each iteration.
255
+
* **Performance Benchmarks Garbage Collection:** In performance benchmarks, force garbage collection before measuring final memory usage by calling `GC.Collect()` and `GC.WaitForPendingFinalizers()` before `GC.GetTotalMemory()`.
256
+
* **Performance Benchmarks Memory Measurement:** In performance benchmarks, use `GC.GetTotalMemory(true)` to get the total memory allocated, including memory that is waiting to be collected.
257
+
* **Performance Benchmarks Removal:** Remove the `BenchmarkMemoryAllocation` test as it is incompatible with our testing setup.
258
+
* **Test Execution:** Don't use `-m:1` when executing tests.
<!-- Configurations that affect the Test Framework -->
4
-
<RunConfiguration>
5
-
<!-- Use 0 for maximum process-level parallelization. This does not force parallelization within the test DLL (on the thread-level). You can also change it from the Test menu; choose "Run tests in parallel". Unchecked = 1 (only 1), checked = 0 (max). -->
6
-
<MaxCpuCount>0</MaxCpuCount>
7
-
<!-- Path relative to directory that contains .runsettings file-->
0 commit comments