Bitcoin full node and query server

Apr 14, 2023

View in context in the libbitcoin Slack #general mirror.

evoskuil05:02
And one more click:
TEMPLATE
bool CLASS::is_match() const NOEXCEPT
{
    using namespace system;
    BC_ASSERT(!is_add_overflow(link_to_position(link_), Link::size));

    if (!memory_)
        return false;

    auto link = memory_->offset(link_to_position(link_) + Link::size);
    if (is_null(link))
        return false;

    BC_PUSH_WARNING(NO_UNSAFE_COPY_N)
    return std::equal(key_.begin(), key_.end(), link);
    BC_POP_WARNING()
}

...this is the memory_->offset(...)

TEMPLATE
inline uint8_t* CLASS::offset(size_t bytes) NOEXCEPT
{
    if (system::is_greater(bytes, size()))
        return nullptr;

    return std::next(begin_, bytes);
}

... in other words, the time is being spent inside std::equal(...).
(edited)