Skip to content

Enhancement: Optimize bundle size/speed, introduce a type of map for dynamic args #25

Description

@mathdebate09

Checks

  • This is not a duplicate of an existing issue (please have a look through our open issues list to make sure)
  • I have thoroughly read and understand Contributing Guide
  • Would you like to work on this enhancement?

Describe the enhancement

  • reduce compiled bundle size and runtime optimizations
  • a workflow to check bundle size and other stats for every PR

Describe the solution you'd like

  • run the .forEach function in each prop only once instead of being spread apart (reduces init/re-init of CPU cycles)
  • implement a tiny LRU cache to maintain repeated dynamic functions, thus reducing re-allocation compile times
  • merge reusable functions for colors and spacing
flowchart LR
  subgraph load [Module load]
    A[spacingScale loops]
    B[colorList loops]
    C[Static literals in flex / sizing]
  end
  subgraph render [Typical render]
    D[Read p.p_4 / m.m_2]
    E[Call p.p_custom]
  end
  load --> D
  load --> E
  E --> F[New object alloc]
Loading
  • flex, height, width and size props should also use spaceScaling
  • minify the library using tsup

Describe alternatives you've considered

(Optional) Additional Comments

No response

(Optional) Discord username

No response

Metadata

Metadata

Assignees

Labels

CIGithub Actions CI related changesEnhancementNew feature or request

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions