
#13569: Optimise code-gen for field-updates of large products -------------------------------------+------------------------------------- Reporter: hvr | Owner: (none) Type: task | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.0.1 (CodeGen) | Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Other | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by bgamari): It's best not to view `memcpy` as a "normal" function. C compilers are generally quite eager to inline and unroll small `memcpy`s and will choose from among multiple implementation depending upon the known alignment and size of the copy. Moreover, they also generally have optimization passes which look for code that functionally resembles `memcpy` and replaces it with the builtin. My understanding is that the advantage of `memcpy` is generally felt when you have blocks of multiples of the wordsize as this allows you to leverage the target's SIMD instructions, using its full memory bandwidth. Consequently, the best case here would be that you memcpy the whole heap object and then do whatever updates are necessary. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13569#comment:5 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler