AddictedCS commented on issue #933:
URL: https://github.com/apache/lucenenet/issues/933#issuecomment-2016720383

   Since I can't remember the exact benchmark data set setup which generated 
12k X degradation, I will edit the issue to reflect the reproducible **30x** 
degradation.
   
   I agree, it seems to be a Microsoft issue, exacerbated when the code 
executes on a macOS ARM chip. The **150x** degradation in `FileStream` when 
writing small files is baffling.
   
   BTW, I've executed @jeme benchmark with added flags in `FileStream` 
initialization: `FileOptions.Asynchronous | FileOptions.RandomAccess | 
FileOptions.WriteThrough`. I was expecting the issue to be gone (if the 
`FSDirectory` change helped, why wouldn't it work in the localized benchmark). 
The results show a slight improvement, but the performance is still unbearable, 
**120x** degradation on macOS ARM.
   
   ```
   BenchmarkDotNet v0.13.12, macOS Sonoma 14.4 (23E214) [Darwin 23.4.0]
   Apple M2 Max, 1 CPU, 12 logical and 12 physical cores
   .NET SDK 8.0.203
     [Host]   : .NET 8.0.3 (8.0.324.11423), Arm64 RyuJIT AdvSIMD
     .NET 7.0 : .NET 7.0.5 (7.0.523.17405), Arm64 RyuJIT AdvSIMD
     .NET 8.0 : .NET 8.0.3 (8.0.324.11423), Arm64 RyuJIT AdvSIMD
   
   Server=True  
   
   | Method      | Job      | Runtime  | Mean         | Error      | StdDev     
| Median       | Ratio  | RatioSD |
   |------------ |--------- |--------- 
|-------------:|-----------:|-----------:|-------------:|-------:|--------:|
   | Write1Kb    | .NET 7.0 | .NET 7.0 |     41.62 μs |   0.226 μs |   0.211 μs 
|     41.62 μs |   1.00 |    0.00 |
   | Write1Kb    | .NET 8.0 | .NET 8.0 |  4,943.71 μs |  97.288 μs | 180.330 μs 
|  4,986.08 μs | 121.49 |    4.02 |
   |             |          |          |              |            |            
|              |        |         |
   | Write2Kb    | .NET 7.0 | .NET 7.0 |     41.02 μs |   0.809 μs |   2.117 μs 
|     41.68 μs |   1.00 |    0.00 |
   | Write2Kb    | .NET 8.0 | .NET 8.0 |  4,860.25 μs |  94.275 μs | 129.045 μs 
|  4,846.69 μs | 119.22 |    9.06 |
   |             |          |          |              |            |            
|              |        |         |
   | Write4Kb    | .NET 7.0 | .NET 7.0 |     41.47 μs |   0.422 μs |   0.374 μs 
|     41.46 μs |   1.00 |    0.00 |
   | Write4Kb    | .NET 8.0 | .NET 8.0 |  4,907.08 μs |  97.922 μs | 146.565 μs 
|  4,886.79 μs | 119.32 |    3.41 |
   |             |          |          |              |            |            
|              |        |         |
   | Write512Kb  | .NET 7.0 | .NET 7.0 |  5,153.03 μs | 102.662 μs | 233.814 μs 
|  5,156.53 μs |   1.00 |    0.00 |
   | Write512Kb  | .NET 8.0 | .NET 8.0 |  5,154.92 μs |  84.612 μs |  97.439 μs 
|  5,161.52 μs |   1.01 |    0.03 |
   |             |          |          |              |            |            
|              |        |         |
   | Write1024Kb | .NET 7.0 | .NET 7.0 |  5,237.81 μs | 102.777 μs | 114.236 μs 
|  5,205.71 μs |   1.00 |    0.00 |
   | Write1024Kb | .NET 8.0 | .NET 8.0 |  5,219.92 μs |  91.374 μs |  85.472 μs 
|  5,228.99 μs |   1.00 |    0.02 |
   |             |          |          |              |            |            
|              |        |         |
   | Write16Mb   | .NET 7.0 | .NET 7.0 | 10,028.00 μs | 198.229 μs | 404.930 μs 
|  9,891.89 μs |   1.00 |    0.00 |
   | Write16Mb   | .NET 8.0 | .NET 8.0 | 10,148.77 μs | 202.662 μs | 465.649 μs 
| 10,070.86 μs |   1.02 |    0.02 |
   
   ```
   
   @jeme let me know if you intend to open an issue in dotnet/core repository. 
I will close this issue then.
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to