Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up Record_optional_labels #7191

Merged
merged 9 commits into from
Dec 5, 2024
Merged

Conversation

cristianoc
Copy link
Collaborator

Clean up Record_optional_labels: determine whether a field is optional directly.

@cristianoc cristianoc force-pushed the types-optional-record-fields branch from a793751 to 7fdf2b5 Compare December 4, 2024 12:45
Base automatically changed from types-optional-record-fields to master December 4, 2024 14:21
Clean up Record_optional_labels: determine whether a field is optional directly.
@cristianoc cristianoc force-pushed the clean-up-record-optional-labels branch from 4c44e34 to 27678d5 Compare December 4, 2024 14:26
Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark 'Syntax Benchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.05.

Benchmark suite Current: c02def3 Previous: e1b7fb7 Ratio
Print RedBlackTreeNoComments.res - time/run 2.2175484733333333 ms 2.10057036 ms 1.06

This comment was automatically generated by workflow using github-action-benchmark.

There's now no global set of optional fields stored anywhere, but optional is attached to each field.
@cristianoc cristianoc requested review from cknitt and zth December 4, 2024 15:07
analysis/src/CreateInterface.ml Outdated Show resolved Hide resolved
compiler/core/js_dump.ml Outdated Show resolved Hide resolved
match y with
| Record_optional_labels lbls2 -> lbls = lbls2
| Record_optional_labels -> true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check if the labels are the same can be safely removed here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes there are no more labels represented here. Each label has its own optionality information.
Later on, we can probably remove the classificationRecord_optional_labels entirely.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cknitt take a look: removed Record_optional_labels entirely, now that the information is available directly from the fields.

@cristianoc
Copy link
Collaborator Author

Removed distinction between regular records and records with optional fields from the back-end.
This has a side effect that previously, if a record r had both optional fields and mandatory field, if a mandatory field f was assigned value undefined, the assignment was omitted. Now it's included.

@cknitt
Copy link
Member

cknitt commented Dec 5, 2024

Removed distinction between regular records and records with optional fields from the back-end. This has a side effect that previously, if a record r had both optional fields and mandatory field, if a mandatory field f was assigned value undefined, the assignment was omitted. Now it's included.

Which seems actually more correct. 👍

Copy link
Member

@cknitt cknitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

];
}
break;
case "xx1" :
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This case is now (correctly) optimized away, right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not quite.
Fixed.

@cristianoc cristianoc merged commit 606719f into master Dec 5, 2024
20 checks passed
@cristianoc cristianoc deleted the clean-up-record-optional-labels branch December 5, 2024 19:15
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