Skip to content

Inline app3/_app3/nodes code. #120

Open
@make-github-pseudonymous-again

Description

With the current implementation we have assert(3 <= list.length && list.length <= 12) in src/0-core/concatenate/nodes.js.

Plan:

  • Write tests that cover all cases in nodes (from list.length = 3 to list.length = 12) 38b9e05
  • Write a benchmark that stresses the concat method
  • Profile current implementation
  • If any of nodes, _app3, app3 shows up as a bottleneck, profile these implementations:
    1. unroll loop iterations in nodes (max iterations is fixed)
    2. switch on list.length in nodes 7362602
    3. handle all cases separately as Digit methods and remove nodes: First implicit branch on the protototype of B, then implicit branch on the prototype of A (e.g. A._nodes_from_list_and_Two(list, B) where B instanceof Two), and finally explicit branch on list.length using a switch

Also the current base cases in app3 use the generic _append and _prepend where list has a size between 1 and 4.

  • Explore unrolling these generic loops in those cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    perfThis issue is about improving performance of the implementation in general

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions