mirror of
https://github.com/simdjson/simdjson
synced 2026-06-08 17:27:07 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8aae14931d | |||
| ef3d1ac25f | |||
| 9292480a9b | |||
| 611ea97dbd | |||
| f249e7e128 | |||
| 44fddaa807 | |||
| be16e1ae04 |
@@ -0,0 +1,22 @@
|
||||
name: Ubuntu 24.04 CI (CXX 20, noexcept)
|
||||
|
||||
on: [push, pull_request]
|
||||
jobs:
|
||||
ubuntu-build:
|
||||
if: >-
|
||||
! contains(toJSON(github.event.commits.*.message), '[skip ci]') &&
|
||||
! contains(toJSON(github.event.commits.*.message), '[skip github]')
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
matrix:
|
||||
cxx: [g++-13, clang++-16]
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- name: Prepare
|
||||
run: cmake -DSIMDJSON_CXX_STANDARD=20 -DSIMDJSON_EXCEPTIONS=OFF -DSIMDJSON_DEVELOPER_MODE=ON -B build
|
||||
env:
|
||||
CXX: ${{matrix.cxx}}
|
||||
- name: Build
|
||||
run: cmake --build build -j=2
|
||||
- name: Test
|
||||
run: ctest --output-on-failure --test-dir build
|
||||
+1
-1
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.14)
|
||||
project(
|
||||
simdjson
|
||||
# The version number is modified by tools/release.py
|
||||
VERSION 4.0.0
|
||||
VERSION 4.0.2
|
||||
DESCRIPTION "Parsing gigabytes of JSON per second"
|
||||
HOMEPAGE_URL "https://simdjson.org/"
|
||||
LANGUAGES CXX C
|
||||
|
||||
@@ -38,7 +38,7 @@ PROJECT_NAME = simdjson
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = "4.0.0"
|
||||
PROJECT_NUMBER = "4.0.2"
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
|
||||
@@ -119,6 +119,7 @@ Godbolt
|
||||
Some users may want to browse code along with the compiled assembly. You want to check out the following lists of examples:
|
||||
* [simdjson examples with errors handled through exceptions](https://godbolt.org/z/7G5qE4sr9)
|
||||
* [simdjson examples with errors without exceptions](https://godbolt.org/z/e9dWb9E4v)
|
||||
* [C++26 reflection example](https://godbolt.org/z/xK5TGKdPb)
|
||||
|
||||
Performance results
|
||||
-------------------
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
add_library(simdjson-internal-flags INTERFACE)
|
||||
if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
|
||||
# We default to ON for all targets, so that we can use the library in shared libraries.
|
||||
set_target_properties(simdjson-internal-flags PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
||||
set_target_properties(simdjson-internal-flags PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
|
||||
|
||||
option(SIMDJSON_CHECK_EOF "Check for the end of the input buffer. The setting is unnecessary since we require padding of the inputs. You should expect tests to fail with this option turned on." OFF)
|
||||
|
||||
+1
-1
@@ -1400,7 +1400,7 @@ maps it to parsing code. We call the default constructor,
|
||||
and then assign values to the public members.
|
||||
|
||||
|
||||
#### Special cases
|
||||
#### Special cases
|
||||
|
||||
However, there are instances where the construction cannot
|
||||
be easily automated. Let us consider a class without any
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
#include <charconv>
|
||||
#include <cstring>
|
||||
#include <experimental/meta>
|
||||
#include <meta>
|
||||
#include <memory>
|
||||
#include <optional>
|
||||
#include <string_view>
|
||||
|
||||
@@ -253,7 +253,9 @@ error_code tag_invoke(deserialize_tag, auto &val, T &out) noexcept(nothrow_deser
|
||||
using value_type = typename std::remove_cvref_t<T>::value_type;
|
||||
|
||||
// Check if the value is null
|
||||
if (val.is_null()) {
|
||||
bool is_null_value;
|
||||
SIMDJSON_TRY( val.is_null().get(is_null_value) );
|
||||
if (is_null_value) {
|
||||
out.reset(); // Set to nullopt
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -361,7 +363,9 @@ error_code tag_invoke(deserialize_tag, simdjson_value &val, std::shared_ptr<T> &
|
||||
// Unique pointers
|
||||
////////////////////////////////////////
|
||||
error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<bool> &out) noexcept {
|
||||
if (val.is_null()) {
|
||||
bool is_null_value;
|
||||
SIMDJSON_TRY( val.is_null().get(is_null_value) );
|
||||
if (is_null_value) {
|
||||
out.reset();
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -374,7 +378,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<bool> &out) no
|
||||
}
|
||||
|
||||
error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<int64_t> &out) noexcept {
|
||||
if (val.is_null()) {
|
||||
bool is_null_value;
|
||||
SIMDJSON_TRY( val.is_null().get(is_null_value) );
|
||||
if (is_null_value) {
|
||||
out.reset();
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -387,7 +393,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<int64_t> &out)
|
||||
}
|
||||
|
||||
error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<uint64_t> &out) noexcept {
|
||||
if (val.is_null()) {
|
||||
bool is_null_value;
|
||||
SIMDJSON_TRY( val.is_null().get(is_null_value) );
|
||||
if (is_null_value) {
|
||||
out.reset();
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -400,7 +408,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<uint64_t> &out
|
||||
}
|
||||
|
||||
error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<double> &out) noexcept {
|
||||
if (val.is_null()) {
|
||||
bool is_null_value;
|
||||
SIMDJSON_TRY( val.is_null().get(is_null_value) );
|
||||
if (is_null_value) {
|
||||
out.reset();
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -413,7 +423,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<double> &out)
|
||||
}
|
||||
|
||||
error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<std::string_view> &out) noexcept {
|
||||
if (val.is_null()) {
|
||||
bool is_null_value;
|
||||
SIMDJSON_TRY( val.is_null().get(is_null_value) );
|
||||
if (is_null_value) {
|
||||
out.reset();
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -430,7 +442,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<std::string_vi
|
||||
// Shared pointers
|
||||
////////////////////////////////////////
|
||||
error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<bool> &out) noexcept {
|
||||
if (val.is_null()) {
|
||||
bool is_null_value;
|
||||
SIMDJSON_TRY( val.is_null().get(is_null_value) );
|
||||
if (is_null_value) {
|
||||
out.reset();
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -443,7 +457,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<bool> &out) no
|
||||
}
|
||||
|
||||
error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<int64_t> &out) noexcept {
|
||||
if (val.is_null()) {
|
||||
bool is_null_value;
|
||||
SIMDJSON_TRY( val.is_null().get(is_null_value) );
|
||||
if (is_null_value) {
|
||||
out.reset();
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -456,7 +472,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<int64_t> &out)
|
||||
}
|
||||
|
||||
error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<uint64_t> &out) noexcept {
|
||||
if (val.is_null()) {
|
||||
bool is_null_value;
|
||||
SIMDJSON_TRY( val.is_null().get(is_null_value) );
|
||||
if (is_null_value) {
|
||||
out.reset();
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -469,7 +487,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<uint64_t> &out
|
||||
}
|
||||
|
||||
error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<double> &out) noexcept {
|
||||
if (val.is_null()) {
|
||||
bool is_null_value;
|
||||
SIMDJSON_TRY( val.is_null().get(is_null_value) );
|
||||
if (is_null_value) {
|
||||
out.reset();
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -482,7 +502,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<double> &out)
|
||||
}
|
||||
|
||||
error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<std::string_view> &out) noexcept {
|
||||
if (val.is_null()) {
|
||||
bool is_null_value;
|
||||
SIMDJSON_TRY( val.is_null().get(is_null_value) );
|
||||
if (is_null_value) {
|
||||
out.reset();
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -504,7 +526,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<std::string_vi
|
||||
////////////////////////////////////////
|
||||
error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<std::string> &out) noexcept {
|
||||
// Check if the value is null
|
||||
if (val.is_null()) {
|
||||
bool is_null_value;
|
||||
SIMDJSON_TRY( val.is_null().get(is_null_value) );
|
||||
if (is_null_value) {
|
||||
out.reset(); // Set to nullptr
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -520,7 +544,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<std::string> &
|
||||
|
||||
error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<std::string> &out) noexcept {
|
||||
// Check if the value is null
|
||||
if (val.is_null()) {
|
||||
bool is_null_value;
|
||||
SIMDJSON_TRY( val.is_null().get(is_null_value) );
|
||||
if (is_null_value) {
|
||||
out.reset(); // Set to nullptr
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -536,7 +562,9 @@ error_code tag_invoke(deserialize_tag, auto &val, std::shared_ptr<std::string> &
|
||||
|
||||
error_code tag_invoke(deserialize_tag, auto &val, std::unique_ptr<int> &out) noexcept {
|
||||
// Check if the value is null
|
||||
if (val.is_null()) {
|
||||
bool is_null_value;
|
||||
SIMDJSON_TRY( val.is_null().get(is_null_value) );
|
||||
if (is_null_value) {
|
||||
out.reset(); // Set to nullptr
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,9 @@ public:
|
||||
using value_type = typename std::remove_cvref_t<T>::value_type;
|
||||
|
||||
// Check if the value is null
|
||||
if (is_null()) {
|
||||
bool is_null_value;
|
||||
SIMDJSON_TRY( is_null().get(is_null_value) );
|
||||
if (is_null_value) {
|
||||
out.reset(); // Set to nullopt
|
||||
return SUCCESS;
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
#define SIMDJSON_SIMDJSON_VERSION_H
|
||||
|
||||
/** The version of simdjson being used (major.minor.revision) */
|
||||
#define SIMDJSON_VERSION "4.0.0"
|
||||
#define SIMDJSON_VERSION "4.0.2"
|
||||
|
||||
namespace simdjson {
|
||||
enum {
|
||||
@@ -19,7 +19,7 @@ enum {
|
||||
/**
|
||||
* The revision (major.minor.REVISION) of simdjson being used.
|
||||
*/
|
||||
SIMDJSON_VERSION_REVISION = 0
|
||||
SIMDJSON_VERSION_REVISION = 2
|
||||
};
|
||||
} // namespace simdjson
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* auto-generated on 2025-09-09 18:44:21 -0400. version 4.0.0 Do not edit! */
|
||||
/* auto-generated on 2025-09-14 09:01:41 -0600. version 4.0.2 Do not edit! */
|
||||
/* including simdjson.cpp: */
|
||||
/* begin file simdjson.cpp */
|
||||
#define SIMDJSON_SRC_SIMDJSON_CPP
|
||||
|
||||
+371
-131
File diff suppressed because it is too large
Load Diff
Binary file not shown.
@@ -8,7 +8,7 @@
|
||||
|
||||
using namespace simdjson;
|
||||
namespace ranges_test {
|
||||
|
||||
#if SIMDJSON_EXCEPTIONS
|
||||
bool printout() {
|
||||
TEST_START();
|
||||
auto cars_json = R"( [
|
||||
@@ -43,6 +43,7 @@ namespace ranges_test {
|
||||
ASSERT_TRUE(std::ranges::equal(cars, expected));
|
||||
TEST_SUCCEED();
|
||||
}
|
||||
#endif // SIMDJSON_EXCEPTIONS
|
||||
|
||||
bool run() {
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user