-
-
Notifications
You must be signed in to change notification settings - Fork 80
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
feat: use simdjson in some FromJson calls #2240
Conversation
MSVC fix please |
|
||
template <class T> | ||
concept ArithmeticSimdjsonUnsupported = Arithmetic<T> && ! | ||
std::is_same_v<T, SimdJsonSupportedType<T>>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bruh
TODO: update clang, it's fine in 18
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ Changes requested. Reviewed everything up to 56050b2 in 1 minute and 44 seconds
More details
- Looked at
913
lines of code in9
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. serialization/include/archives/SimdJsonInputArchive.h:255
- Draft comment:
Ensure that the lifetime ofsimdjson::dom::element
outlives theSimdJsonInputArchive
instance to avoid dangling references. - Reason this comment was not posted:
Confidence changes required:50%
TheSimdJsonInputArchive
class has a private memberinput
which is a reference to asimdjson::dom::element
. This is fine, but it should be noted that the lifetime of thesimdjson::dom::element
must outlive theSimdJsonInputArchive
instance to avoid dangling references. This is a potential source of bugs if not handled carefully.
2. skymp5-server/cpp/server_guest_lib/Inventory.cpp:179
- Draft comment:
Good use ofSimdJsonInputArchive
to parsesimdjson::dom::element
directly for performance. - Reason this comment was not posted:
Confidence changes required:0%
TheInventory::FromJson
function is correctly usingSimdJsonInputArchive
to parse thesimdjson::dom::element
. This is a good practice for performance and should be followed in other similar functions.
Workflow ID: wflow_Wtj2AibcMVRk2OqW
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
struct SimdJsonSupportedTypeAdapter | ||
{ | ||
template <std::signed_integral T> | ||
std::decay<int64_t> MapType(T); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
std::decay<int64_t>
should be std::decay_t<int64_t>
. This applies to other uses of std::decay
in this struct as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(no idea if you can talk to this bot, but they say you can, so let's try lol)
On purpose to have ReturnType::type
return the target type , otherwise would get this
template <class T>
using SimdJsonSupportedType =
typename decltype(std::declval<SimdJsonSupportedTypeAdapter>().MapType(
std::declval<T>()));
Expected a qualified name after 'typename' clang(expected_qualified_after_typename)
If there's a cleaner way to do so, please suggest
Important
Introduces
SimdJsonInputArchive
for JSON parsing withsimdjson
, updating relevant classes and tests for improved performance.SimdJsonInputArchive
class inSimdJsonInputArchive.h
for JSON parsing usingsimdjson
.JsonInputArchive
withSimdJsonInputArchive
inMessageBase.h
,Equipment.cpp
, andInventory.cpp
.MessageSerializerFactory.cpp
to usesimdjson
for parsing JSON messages.ArchiveTest.cpp
to testSimdJsonInputArchive
functionality.MovementSerializationTest.cpp
to test JSON serialization/deserialization withsimdjson
.This description was created by
for 56050b2. It will automatically update as commits are pushed.