Skip to content

refactor: extract applyDictWithRepStitch to reduce allocation pressure in decodeDictV1 rep-level path#193

Open
darthcoder wants to merge 2 commits intoDataHaskell:mainfrom
darthcoder:main
Open

refactor: extract applyDictWithRepStitch to reduce allocation pressure in decodeDictV1 rep-level path#193
darthcoder wants to merge 2 commits intoDataHaskell:mainfrom
darthcoder:main

Conversation

@darthcoder
Copy link
Copy Markdown

@darthcoder darthcoder commented Apr 8, 2026

Summary

  • Extracts applyDictWithRepStitch from the rep-level branch of decodeDictV1, replacing a 27-line inline do/case block with a single call
  • Uses VU.map (ds V.!) (stays in unboxed vector space) instead of map (ds V.!) . VU.toList for all VU.Unbox types (Bool, Int32, Int64, Float, Double), avoiding materialisation of an intermediate list
  • UTCTime (DInt96) and Text (DText) have no VU.Unbox instance and correctly fall back to map (ds V.!) (VU.toList idxs)

Closes / relates to #151.

Test plan

  • cabal test — all 453 HUnit cases pass, all 23 QuickCheck suites pass (100 tests each)
  • No changes outside src/DataFrame/IO/Parquet/Dictionary.hs

🤖 Generated with Claude Code

…epStitch

- Add missing `Int` parameter (maxDef) to the type signature
- Use `map (ds V.!) (VU.toList idxs)` for DInt96 and DText, since
  UTCTime and Text have no VU.Unbox instance and cannot be produced
  by VU.map
@darthcoder
Copy link
Copy Markdown
Author

this is in regards my gsoc application for summer of haskell. hope this is not a waste of the mentors time. While i wanted to learn sufficient amount of haskell to be productive on my own I had to rely a bit on claude in the clutch. If the AI policy is no ai usage then I am willing to only checkin handwritten code from the next time onwards but since the complete test suite is passing and the fix is what i intended it to be even if i am not proficient enough in the syntax i hope it is accepted.

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