Implement manual Copy on write – Swift questions

Hi,

 

Apple in his document about Writing High-Performance Swift Code, explains a way to do the Copy on Write manually, here:

 

https://github.com/apple/swift/blob/master/docs/OptimizationTips.rst#advice-use-copy-on-write-semantics-for-large-values

 

Nice section, but this arises some questions to me:

 

  • When we should start to consider to use manual Copy on Write?
  • What can be a large value?
  • How that cost can be measured?
  • Any reference to benchmarks / memory usage using COW?
  • How we can solve the non thread safe nature for the copy on write?

 

Thanks

Powered by WPeMatico

About

You may also like...

Comments are closed.