#2289: Needless reboxing of values when returning from a tight loop
----------------------------------------+-----------------------------------
Reporter: dons | Owner:
Type: run-time performance bug | Status: new
Priority: normal | Milestone:
Component: Compiler | Version: 6.8.2
Severity: normal | Resolution:
Keywords: boxing, loops, performance | Difficulty: Unknown
Testcase: | Architecture: Unknown
Os: Unknown |
----------------------------------------+-----------------------------------
Comment (by dons):
Looking in the CPR analyser, I see the following comment:
The analysis here detects nested CPR information. For example, if a
function returns a constructed pair, the first element of which is a
constructed int, then the analysis will detect nested CPR information
for the int as well. Unfortunately, the current transformations can't
take advantage of the nested CPR information. They have (broken now,
I think) code which will flatten out nested CPR components and rebuild
them in the wrapper, but enabling this would lose laziness. It is
possible to make use of the nested info: if we knew that a caller was
strict in that position then we could create a specialized version of
the function which flattened/reconstructed that position.
It is not known whether this optimisation would be worthwhile.
So, there's some skeleton code in their for the nested CPR stuff. And the
CPR analyser seems pretty small too. Would working on this be worthwhile
now?
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2289#comment:4>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs