Comparing dev...parallel · elastic/mito · GitHub
Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: elastic/mito
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dev
Choose a base ref
...
head repository: elastic/mito
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: parallel
Choose a head ref
Checking mergeability… Don’t worry, you can still create the pull request.
  • 1 commit
  • 7 files changed
  • 1 contributor

Commits on Jun 25, 2026

  1. lib: add parallel map macro

    Add a .parallel() macro that mirrors .map() but evaluates body
    expressions concurrently. Three call forms are supported:
    
        range.parallel(v, expr)       // apply to every element
        range.parallel(v, pred, expr) // apply where pred is true
        range.parallel(v, v2, expr)   // two-variable (index/key + value)
    
    Concurrency is controlled by two knobs set at the environment level
    via Parallel(perCall, globalCap):
    
      - perCall bounds goroutines per .parallel() invocation (defaults to
        GOMAXPROCS).
      - globalCap bounds total concurrent leaf evaluations across all
        .parallel() calls in the program (0 means unlimited).
    
    When perCall == 1 the macro degenerates to a sequential comprehension
    with no goroutine overhead.
    
    Output order always matches input order. Errors are surfaced
    deterministically: the first error in iteration order is returned.
    
    The implementation uses sentinel function calls (@parallel,
    @parallel_body, @parallel_pred) in the AST so that decorators can
    recover the planned body and predicate Interpretables at program
    construction time, working around the unexported evalFold in cel-go.
    efd6 committed Jun 25, 2026
    Configuration menu
    Copy the full SHA
    0881b28 View commit details
    Browse the repository at this point in the history
Loading