Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Write data to compact regions through destination "filling" #450

Draft
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

tbagrel1
Copy link
Member

@tbagrel1 tbagrel1 commented May 3, 2023

This PR provides a way to fill compact regions (GHC.Compact) through destination filling, with mutations under the hood.

It aims to reduce the number of allocations needed to copy data in a compact region for specific workloads such as parsers or deserializers.

@tbagrel1 tbagrel1 force-pushed the tbagrel1/dest-pure-interface branch 2 times, most recently from ab991ec to 396efdd Compare May 3, 2023 13:18
@tbagrel1
Copy link
Member Author

Here's a performance report at commit c86e68f:

Benchmark memory: RUNNING...
All                      
  compact region allocs  
    parser without dest: OK (0.43s)
      203  μs ±  16 μs, 1.1 MB allocated,  18 KB copied,  10 MB peak memory
    parser using dest:   OK (0.13s)
      253  μs ±  21 μs, 1.4 MB allocated,  10 KB copied,  10 MB peak memory

memory_using_dest_c86e68fca2a3f1ce4ea5aa18c31e336059d1ccbd.txt
memory_without_dest_c86e68fca2a3f1ce4ea5aa18c31e336059d1ccbd.txt

@Jashweii Jashweii mentioned this pull request May 12, 2024
@tbagrel1 tbagrel1 force-pushed the tbagrel1/dest-pure-interface branch from 2cfbd97 to a9226ce Compare September 20, 2024 10:10
@tbagrel1 tbagrel1 force-pushed the tbagrel1/dest-pure-interface branch from a9226ce to 868b732 Compare September 20, 2024 13:51
@tbagrel1 tbagrel1 force-pushed the tbagrel1/dest-pure-interface branch from 868b732 to 1fcd12d Compare October 7, 2024 14:29
@tbagrel1
Copy link
Member Author

tbagrel1 commented Oct 7, 2024

I'm reviving this PR after one year.

The new implementation works with a custom GHC version, that adds 3 new primitives to efficiently allocate inside compact regions without copying.

It is based on my JFLA article https://inria.hal.science/hal-04406360/document and HIW presentation https://www.youtube.com/live/uMurx1a6Zck?si=kNR2Qsj-6hVGdlP2&t=10579

@tbagrel1 tbagrel1 force-pushed the tbagrel1/dest-pure-interface branch from c7ee58e to 5d88d26 Compare November 8, 2024 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant