Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,828
    • Issues 4,828
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 447
    • Merge requests 447
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #19612

Closed
Open
Created Mar 28, 2021 by Sebastian Graf@sgraf812Developer

Split up PState

The PState record is huge (25 fields) and will be updated on every token lexed. That's about 25*8=200 bytes allocation for every byte lexed, for PState update alone! I see that we already store a ParserOpts field in PState that will probably be mostly constant throughout. But there are also a lot of other fields which probably don't change that often, which we could push into a secondary state parameter. E.g. maybe we can manage to have a HotPState (buffer, last_tk, *loc, ...) that is small and changes for every AlexToken emitted and a SlowPState (warnings, errors, tab_fist, ...) that changes only sometimes. Maybe split up that one too into a State record for things that are modified together. We could thread them as separate parameters in the P monad or as a tuple/strict PState record.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking