Skip to content

Fix issue 23367 - Preserve sparse array literal encoding in copyLiteral - #23472

Merged
thewilsonator merged 3 commits into
dlang:masterfrom
gulugulubing:fix-issue-23367-plan-b
Jul 29, 2026
Merged

Fix issue 23367 - Preserve sparse array literal encoding in copyLiteral#23472
thewilsonator merged 3 commits into
dlang:masterfrom
gulugulubing:fix-issue-23367-plan-b

Conversation

@gulugulubing

Copy link
Copy Markdown
Contributor

This is a follow-up to @ntrel's #23372. It seems that the indexes problem is almost entirely within CTFE (ctfeexpr.d + dinterpret.d), mush less than originally thought.

If it's acceptable, I'll delete #23451.

@thewilsonator

Copy link
Copy Markdown
Contributor

Have had the chance to run some performance tests? Otherwise looks good.

@gulugulubing

Copy link
Copy Markdown
Contributor Author

Have had the chance to run some performance tests? Otherwise looks good.

Just did a test:

enum x = {
    int[10_000_000][] pieces = [];
    pieces.length = 5;
    return pieces[0][0];
}();

void main() {}

The new plan is 6x faster, ~75% less peak memory (RSS ~40% less for this test case).

@thewilsonator
thewilsonator merged commit 18a4b70 into dlang:master Jul 29, 2026
42 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants