Skip to content

Create benchmark for [[likely]] performance #96

@uselessgoddess

Description

@uselessgoddess

See the new attribute [[likely]]

compare (see this link)

        if (n <= MaximumFactorialNumber)
        {
            return Internal::_factorials[n];
        }
        else
        {
            throw std::out_of_range(std::string("Only numbers from 0 to ").append(std::to_string(MaximumFactorialNumber)).append("are supported by unsigned integer with 64 bits length."));
        }

And

        if (n <= MaximumFactorialNumber) [[likely]]
        {
            return Internal::_factorials[n];
        }
        else [[unlikely]]
        {
            throw std::out_of_range(std::string("Only numbers from 0 to ").append(std::to_string(MaximumFactorialNumber)).append("are supported by unsigned integer with 64 bits length."));
        }

Metadata

Metadata

Assignees

No one assigned

    Labels

    performanceThis can be done faster

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions