Compare commits

..

2 Commits

Author SHA1 Message Date
Daniel Lemire 34dcd33a88 Patch. 2023-03-09 11:24:06 -05:00
Daniel Lemire 17a1a8e187 Adding -Og to debug builds. (#1964)
* Adding -Og to debug builds.

* Stupid compiler.

* bad, bad, bad compiler
2023-03-09 11:14:42 -05:00
7 changed files with 26 additions and 11 deletions
+16 -1
View File
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.14)
project(
simdjson
# The version number is modified by tools/release.py
VERSION 3.1.4
VERSION 3.1.5
DESCRIPTION "Parsing gigabytes of JSON per second"
HOMEPAGE_URL "https://simdjson.org/"
LANGUAGES CXX C
@@ -95,6 +95,21 @@ if(
)
endif()
# GCC and Clang have horrendous Debug builds when using SIMD.
# A common fix is to use '-Og' instead.
# bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412
if(
(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR
CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
AND CMAKE_BUILD_TYPE STREQUAL "Debug"
)
simdjson_add_props(
target_compile_options PRIVATE
-Og
)
endif()
if(SIMDJSON_ENABLE_THREADS)
find_package(Threads REQUIRED)
simdjson_add_props(target_link_libraries PUBLIC Threads::Threads)
+1 -1
View File
@@ -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 = "3.1.4"
PROJECT_NUMBER = "3.1.5"
# 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
+2 -2
View File
@@ -4,7 +4,7 @@
#define SIMDJSON_SIMDJSON_VERSION_H
/** The version of simdjson being used (major.minor.revision) */
#define SIMDJSON_VERSION "3.1.4"
#define SIMDJSON_VERSION "3.1.5"
namespace simdjson {
enum {
@@ -19,7 +19,7 @@ enum {
/**
* The revision (major.minor.REVISION) of simdjson being used.
*/
SIMDJSON_VERSION_REVISION = 4
SIMDJSON_VERSION_REVISION = 5
};
} // namespace simdjson
+1 -1
View File
@@ -1,4 +1,4 @@
/* auto-generated on 2023-03-09 10:42:23 -0500. Do not edit! */
/* auto-generated on 2023-03-09 11:14:42 -0500. Do not edit! */
/* begin file src/simdjson.cpp */
#include "simdjson.h"
+3 -3
View File
@@ -1,4 +1,4 @@
/* auto-generated on 2023-03-09 10:42:23 -0500. Do not edit! */
/* auto-generated on 2023-03-09 11:14:42 -0500. Do not edit! */
/* begin file include/simdjson.h */
#ifndef SIMDJSON_H
#define SIMDJSON_H
@@ -43,7 +43,7 @@
#define SIMDJSON_SIMDJSON_VERSION_H
/** The version of simdjson being used (major.minor.revision) */
#define SIMDJSON_VERSION "3.1.4"
#define SIMDJSON_VERSION "3.1.5"
namespace simdjson {
enum {
@@ -58,7 +58,7 @@ enum {
/**
* The revision (major.minor.REVISION) of simdjson being used.
*/
SIMDJSON_VERSION_REVISION = 4
SIMDJSON_VERSION_REVISION = 5
};
} // namespace simdjson
+1 -1
View File
@@ -140,7 +140,7 @@ bool tester(int seed, size_t volume) {
std::vector<char> buffer(1024); // large buffer (can't overflow)
simdjson::dom::parser parser;
RandomEngine rand(seed);
double result;
double result{};
for (size_t i = 0; i < volume; i++) {
if((i%100000) == 0) { std::cout << "."; std::cout.flush(); }
size_t length = build_random_string(rand, buffer.data());
+2 -2
View File
@@ -123,7 +123,7 @@ void recurse(simdjson::dom::element element, stat_t &s, size_t depth) {
if (element.is<int64_t>()) {
s.integer_count++; // because an int can be sometimes represented as a double, we
// to check whether it is an integer first!!!
int64_t v;
int64_t v{};
error = element.get(v);
SIMDJSON_ASSUME(!error);
if((v >= std::numeric_limits<int32_t>::min()) and (v <= std::numeric_limits<int32_t>::max()) ) {
@@ -138,7 +138,7 @@ void recurse(simdjson::dom::element element, stat_t &s, size_t depth) {
} else if (element.is<double>()) {
s.float_count++;
} else if (element.is<bool>()) {
bool v;
bool v{};
error = element.get(v);
SIMDJSON_ASSUME(!error);
if (v) {