Skip to content

byte-code-and-object-code unnecessarily generate interface objects in interpreter mode

Summary

if GHCi is invoked with -fbyte-code-and-object-code only, this option does not have any effect from the user's perspective. Byte code objects are already generated as the necessary GHCi operation, but additional interface objects are generated and held in memory. This should be regarded as feature misalignment and we need to turn that operation off if GHC mode is the interpreter mode.

A repl session without -fbyte-code-and-object-code heap profile: Screenshot_2024-02-23_at_8.52.50_AM detailed: Screenshot_2024-02-23_at_8.55.21_AM

The same repl session with -fbyte-code-and-object-code heap profile: Screenshot_2024-02-23_at_8.54.25_AM detailed: Screenshot_2024-02-23_at_8.56.44_AM

Steps to reproduce

Take a big project for the build of which GHC memory footprint is large. Open a GHCi repl session with and without -fbyte-code-and-object-code and compare the memory usage.

Expected behavior

The flag which does not have any impact should not give different resource usage.

Environment

  • GHC version used: 9.6.3

Optional:

  • Operating System: macOS Sonoma 14.3
  • System Architecture: Apple M1 Max
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information