Skip to content

Suggestion: Consider using Symbol type for Labels? #4

@Antti-L

Description

@Antti-L

I would suggest considering to use the Symbol type for the item labels (i.e. those that are called labels in GAMS). These should be immutable anyway, and therefore I think the symbol type would seem to fit well, and may have some performance benefits.

Quote from educative.io:

Unlike strings, symbols are immutable, which means their values cannot be changed once created. This immutability grants symbols a few advantages over strings, especially in certain programming scenarios. One significant advantage of symbol immutability is its efficiency in comparison operations. When comparing two symbols, Julia simply needs to check their memory addresses to determine if they refer to the same symbol. In contrast, comparing two strings requires examining each character in the strings until a mismatch is found or confirming that the entire strings are identical.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions