Code becomes slower as more boxed arrays are allocated

后端 未结 2 1031
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-07 17:45

Edit: It turns out that things generally (not just array/ref operations) slow down the more arrays have been created, so I guess this might just be meas

2条回答
  •  一整个雨季
    2021-01-07 18:20

    I think you're definitely seeing GC effects. I had a related issue in cassava (https://github.com/tibbe/cassava/issues/49#issuecomment-34929984) where the GC time was increasing linearly with increasing heap size.

    Try to measure how the GC time and mutator time increase as you hold on to more and more arrays in memory.

    You can reduce GC time with playing with the +RTS options. For example, try setting -A to your L3 cache size.

提交回复
热议问题