Skip to content
Snippets Groups Projects

Prefer packed representation for CompiledByteCode

Closed Hannes Siebenhandl requested to merge fendor/ghc:wip/fendor/array-bcos into master

As there are many 'CompiledByteCode' objects alive during a GHCi session, representing its element in a more packed manner improves space behaviour at a minimal cost.

When running GHCi on the agda codebase, we find around 380 live 'CompiledByteCode' objects. Packing their respective 'UnlinkedByteCode' can save quite some pointers.

In experiments on the agda codebase, the number of live bytes was reduced by around 15MB, which is roughly 2% of the overall live bytes. These numbers have been obtained using -hT -i1 -l.

Thank you for your contribution to GHC!

Please read the checklist below to make sure your contribution fulfills these expectations. Also please answer the following question in your MR description:

Where is the key part of this patch? That is, what should reviewers look at first?

Please take a few moments to address the following points:

  • if your MR may break existing programs (e.g. touches base or causes the compiler to reject programs), please describe the expected breakage and add the user-facing label. This will run ghc/head.hackage> to characterise the effect of your change on Hackage.
  • ensure that your commits are either individually buildable or squashed
  • ensure that your commit messages describe what they do (referring to tickets using #NNNN syntax when appropriate)
  • have added source comments describing your change. For larger changes you likely should add a Note and cross-reference it from the relevant places.
  • add a testcase to the testsuite.
  • updates the users guide if applicable
  • mentions new features in the release notes for the next release

If you have any questions don't hesitate to open your merge request and inquire in a comment. If your patch isn't quite done yet please do add prefix your MR title with WIP:.

By default a minimal validation pipeline is run on each merge request, the full-ci label can be applied to perform additional validation checks if your MR affects a more unusual configuration.

Once your change is ready please remove the WIP: tag and wait for review. If no one has offered a review in a few days then please leave a comment mentioning @triagers and apply the Blocked on Review label.

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
49 51 -- -----------------------------------------------------------------------------
50 52 -- Compiled Byte Code
51 53
54 type UnlinkedBCOArr = Array Int UnlinkedBCO
55
52 56 data CompiledByteCode = CompiledByteCode
53 { bc_bcos :: [UnlinkedBCO] -- Bunch of interpretable bindings
57 { bc_bcos :: UnlinkedBCOArr -- Bunch of interpretable bindings
54 58 , bc_itbls :: ItblEnv -- A mapping from DataCons to their itbls
55 59 , bc_ffis :: [FFIInfo] -- ffi blocks we allocated
  • 64 68 instance Outputable CompiledByteCode where
    65 69 ppr CompiledByteCode{..} = ppr bc_bcos
    66 70
    71 instance Outputable (Array Int UnlinkedBCO) where
  • 49 51 -- -----------------------------------------------------------------------------
    50 52 -- Compiled Byte Code
    51 53
    54 type UnlinkedBCOArr = Array Int UnlinkedBCO
    55
    52 56 data CompiledByteCode = CompiledByteCode
    53 { bc_bcos :: [UnlinkedBCO] -- Bunch of interpretable bindings
    57 { bc_bcos :: UnlinkedBCOArr -- Bunch of interpretable bindings
  • added 1 commit

    • d248a67c - Prefer packed representation for CompiledByteCode

    Compare with previous version

  • added 1 commit

    • c0d319e6 - Prefer packed representation for CompiledByteCode

    Compare with previous version

  • added 1 commit

    • fcd5acb9 - Prefer packed representation for CompiledByteCode

    Compare with previous version

  • added 1 commit

    • 42564352 - Prefer packed representation for CompiledByteCode

    Compare with previous version

  • I think it would be best if we replace BCOArr with FlatBag from !12170 (closed).

  • 289 289 forceModIface.
    290 290 -}
    291 291
    292
    293 {- Note [Storing flat structures in 'ModIface']
  • Is this blocked on !12170 (closed) ?

  • Yes, I think this PR should use FlatBag instead of BCOArr.

  • Hannes Siebenhandl added 203 commits

    added 203 commits

    Compare with previous version

  • added 1 commit

    • 1b1d37c6 - Prefer packed representation for CompiledByteCode

    Compare with previous version

  • added 1 commit

    • ce39e4d6 - Prefer packed representation for CompiledByteCode

    Compare with previous version

  • added 1 commit

    • 13b0d8ef - Prefer packed representation for CompiledByteCode

    Compare with previous version

  • Matthew Pickering assigned to @marge-bot and unassigned @fendor

    assigned to @marge-bot and unassigned @fendor

  • added 5 commits

    Compare with previous version

  • added 1 commit

    • 0e00847f - Prefer packed representation for CompiledByteCode

    Compare with previous version

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading