dev: Add RecentMessages benchmark (#5071)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
nerix
2024-01-07 13:15:36 +01:00
committed by GitHub
parent 78a7ebb9f9
commit f42ae07408
22 changed files with 446 additions and 119 deletions
+14 -11
View File
@@ -149,19 +149,22 @@ namespace {
return authorityBadge;
}
EmoteMap parseChannelEmotes(const QJsonObject &jsonRoot)
{
auto emotes = EmoteMap();
for (const auto emoteSetRef : jsonRoot["sets"].toObject())
{
parseEmoteSetInto(emoteSetRef.toObject(), "Channel", emotes);
}
return emotes;
}
} // namespace
using namespace ffz::detail;
EmoteMap ffz::detail::parseChannelEmotes(const QJsonObject &jsonRoot)
{
auto emotes = EmoteMap();
for (const auto emoteSetRef : jsonRoot["sets"].toObject())
{
parseEmoteSetInto(emoteSetRef.toObject(), "Channel", emotes);
}
return emotes;
}
FfzEmotes::FfzEmotes()
: global_(std::make_shared<EmoteMap>())
{
+8
View File
@@ -3,6 +3,8 @@
#include "common/Aliases.hpp"
#include "common/Atomic.hpp"
#include <QJsonObject>
#include <memory>
#include <optional>
@@ -13,6 +15,12 @@ using EmotePtr = std::shared_ptr<const Emote>;
class EmoteMap;
class Channel;
namespace ffz::detail {
EmoteMap parseChannelEmotes(const QJsonObject &jsonRoot);
} // namespace ffz::detail
class FfzEmotes final
{
public: