potential for controlling memory alignment?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

potential for controlling memory alignment?

Nicolas Frisby
On my laptop, a program showed a consistent slowdown with -fdicts-strict

I didn't find any obvious causes in the Core differences, so I turned to
Intel's Performance Counter Monitor for measurements. After trying a few
counters, I eventuall saw that there are about an order of magnitude more
misaligned memory loads with -fdicts-strict than without, so I think that
may be a significant part of the slowdown. I'm not sure if these are code
or data reads.

Can anyone suggest how to validate this hypothesis about misaligned reads?

A subsequent commit has changed the behavior I was seeing, so I'm not
interested in alternatives means to determine if -fdicts-strict is somehow
at fault ? I'm just asking specifically about data/code memory alignment in
GHC and how to diagnose/experiment with it.

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130912/9cfd0873/attachment.htm>

Reply | Threaded
Open this post in threaded view
|

potential for controlling memory alignment?

Carter Schonwald
Reid Barton was just noticing some  alignment perf issues  and talking
about it on #ghc / #haskell-llvm

probably worth documenting it in a ticket!



On Thu, Sep 12, 2013 at 3:28 PM, Nicolas Frisby <nicolas.frisby at gmail.com>wrote:

> On my laptop, a program showed a consistent slowdown with -fdicts-strict
>
> I didn't find any obvious causes in the Core differences, so I turned to
> Intel's Performance Counter Monitor for measurements. After trying a few
> counters, I eventuall saw that there are about an order of magnitude more
> misaligned memory loads with -fdicts-strict than without, so I think that
> may be a significant part of the slowdown. I'm not sure if these are code
> or data reads.
>
> Can anyone suggest how to validate this hypothesis about misaligned reads?
>
> A subsequent commit has changed the behavior I was seeing, so I'm not
> interested in alternatives means to determine if -fdicts-strict is somehow
> at fault ? I'm just asking specifically about data/code memory alignment in
> GHC and how to diagnose/experiment with it.
>
> Thanks.
>
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130912/ca6d4fce/attachment.htm>

Reply | Threaded
Open this post in threaded view
|

potential for controlling memory alignment?

Carter Schonwald
i created a ticket on trac
http://ghc.haskell.org/trac/ghc/ticket/8279


On Thu, Sep 12, 2013 at 3:46 PM, Carter Schonwald <
carter.schonwald at gmail.com> wrote:

> Reid Barton was just noticing some  alignment perf issues  and talking
> about it on #ghc / #haskell-llvm
>
> probably worth documenting it in a ticket!
>
>
>
> On Thu, Sep 12, 2013 at 3:28 PM, Nicolas Frisby <nicolas.frisby at gmail.com>wrote:
>
>> On my laptop, a program showed a consistent slowdown with -fdicts-strict
>>
>> I didn't find any obvious causes in the Core differences, so I turned to
>> Intel's Performance Counter Monitor for measurements. After trying a few
>> counters, I eventuall saw that there are about an order of magnitude more
>> misaligned memory loads with -fdicts-strict than without, so I think that
>> may be a significant part of the slowdown. I'm not sure if these are code
>> or data reads.
>>
>> Can anyone suggest how to validate this hypothesis about misaligned reads?
>>
>> A subsequent commit has changed the behavior I was seeing, so I'm not
>> interested in alternatives means to determine if -fdicts-strict is somehow
>> at fault ? I'm just asking specifically about data/code memory alignment in
>> GHC and how to diagnose/experiment with it.
>>
>> Thanks.
>>
>>
>> _______________________________________________
>> ghc-devs mailing list
>> ghc-devs at haskell.org
>> http://www.haskell.org/mailman/listinfo/ghc-devs
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/ghc-devs/attachments/20130912/e71ee9f6/attachment.htm>

Reply | Threaded
Open this post in threaded view
|

potential for controlling memory alignment?

Simon Marlow-7
In reply to this post by Nicolas Frisby
On 12/09/13 20:28, Nicolas Frisby wrote:

> On my laptop, a program showed a consistent slowdown with -fdicts-strict
>
> I didn't find any obvious causes in the Core differences, so I turned to
> Intel's Performance Counter Monitor for measurements. After trying a few
> counters, I eventuall saw that there are about an order of magnitude
> more misaligned memory loads with -fdicts-strict than without, so I
> think that may be a significant part of the slowdown. I'm not sure if
> these are code or data reads.
>
> Can anyone suggest how to validate this hypothesis about misaligned reads?

Is this 32 bit or 64 bit?  On 32 bits we might get misaligned loads of
doubles from the heap and stack, but we shouldn't have that problem on
64-bit.

If you're on Linux you can use perf to track misaligned accesses and
annotate the assembly to find the hotspots.  Some info on the wiki here:
http://ghc.haskell.org/trac/ghc/wiki/Debugging/LowLevelProfiling/Perf

Cheers,
        Simon


> A subsequent commit has changed the behavior I was seeing, so I'm not
> interested in alternatives means to determine if -fdicts-strict is
> somehow at fault ? I'm just asking specifically about data/code memory
> alignment in GHC and how to diagnose/experiment with it.
>
> Thanks.
>
>
>
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs
>