stan-dev / stan-dev/stanc3

SoA optimization can over-promote objects used inside loops to produce slower code

Open
#1,280 0 comments 0 reactions 0 assignees View on GitHub

@SteveBronder is already working on this.

Since May 3, 2023.

  • #3188 by @SteveBronder — open
bug cpp-codegen optimization
Dominant language
OCaml
Stars
160
Forks
59
Avg merge
21h 45m
Merged PRs (30d)
26

Description

Current Behavior:

See this forum thread by @mike-lawrence which contains an example that is ~5x slower at --O1 compared to the default.

Expected Behavior:

SoA optimization should not promote things being assigned to inside of a tight for loop

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked forum example and inspect open pull request #3188 for the current implementation direction. Verify with that example that SoA optimization does not promote objects assigned inside tight for loops and that the reported slowdown at --O1 is addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
ocaml
Domain
compilers, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.