chaokunyang opened a new issue, #3460:
URL: https://github.com/apache/fory/issues/3460

   ### Feature Request
   
   Reduce swift_beginAccess cost to optimize performance
   
   
   
   ### Is your feature request related to a problem? Please describe
   
   
   # Baseline Benchmark Numbers (commit In 
https://github.com/chaokunyang/fory/commit/cd360e2f64233f622103628372a7b60e6275712e)
   
   | Benchmark | ns/op | ops/sec |
   |-----------|-------|---------|
   | Struct Serialize | 58.60 | 17,064,577 |
   | Struct Deserialize | 66.56 | 15,024,390 |
   | Sample Serialize | 300.69 | 3,325,648 |
   | Sample Deserialize | 942.51 | 1,061,000 |
   | MediaContent Serialize | 686.30 | 1,457,097 |
   | MediaContent Deserialize | 1669.27 | 599,065 |
   | StructList Serialize | 364.29 | 2,745,061 |
   | StructList Deserialize | 406.82 | 2,458,083 |
   | SampleList Serialize | 1420.34 | 704,059 |
   | SampleList Deserialize | 4986.70 | 200,533 |
   | MediaContentList Serialize | 2994.44 | 333,952 |
   | MediaContentList Deserialize | 8014.31 | 124,777 |
   
   # https://github.com/apache/fory/pull/3457 (HEAD) Performance
   
   | Benchmark | ns/op | ops/sec | Regression |
   |-----------|-------|---------|------------|
   | Struct Serialize | 106.13 | 9,422,352 | 1.81x slower |
   | Struct Deserialize | 87.18 | 11,470,519 | 1.31x slower |
   | Sample Serialize | 290.24 | 3,445,375 | OK (slightly faster) |
   | Sample Deserialize | 995.39 | 1,004,627 | 1.06x slower |
   | MediaContent Serialize | 688.33 | 1,452,791 | OK |
   | MediaContent Deserialize | 1635.96 | 611,262 | OK (slightly faster) |
   | StructList Serialize | 366.24 | 2,730,416 | OK |
   | StructList Deserialize | 376.84 | 2,653,632 | OK (faster) |
   | SampleList Serialize | 1445.54 | 691,784 | OK |
   | SampleList Deserialize | 4992.00 | 200,320 | OK |
   | MediaContentList Serialize | 2991.15 | 334,320 | OK |
   | MediaContentList Deserialize | CRASH | CRASH | FATAL ERROR |
   
   ## Key Issues
   1. **Struct Serialize**: 1.81x regression (58.60 -> 106.13 ns/op)
   2. **Struct Deserialize**: 1.31x regression (66.56 -> 87.18 ns/op)
   
   The cost are mostly in swift Access checks
   
   ### Describe the solution you'd like
   
   Find an approach to reduce such costs
   
   ### Describe alternatives you've considered
   
   #3355
   #3457
   
   ### Additional context
   
   _No response_


-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to