core.match

Investigate non-overlapping pattern optimization via pre-allocated exception for backtracking

Details

  • Type: Task Task
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

The red black tree balance pattern mentioned by tgk generates enough code that the JVM will not inline it. Maranget's algorithm basically implements backtracking by passing along wildcard matches with actual matches. For non-overlapping patterns like the red black tree balance pattern this means exponential code size.

For such patterns where none of the actions involve recur we could implement backtracking with a pre-allocated exception.

http://blogs.oracle.com/jrose/entry/longjumps_considered_inexpensive

Activity

David Nolen made changes -
Field Original Value New Value
Status Open [ 1 ] In Progress [ 3 ]
Hide
David Nolen added a comment -

Fixed now in master.

Show
David Nolen added a comment - Fixed now in master.
David Nolen made changes -
Status In Progress [ 3 ] Resolved [ 5 ]
Resolution Completed [ 1 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: