... you are too slow and QJson API is so ugly.
Now using this wonderful json lib:
https://github.com/nlohmann/json
Results in release mode (QJson tests are not shown but
QJson was even slower than string concat).
PASS : TestQgsJsonUtils::testExportAttributesJson(Use json)
RESULT : TestQgsJsonUtils::testExportAttributesJson():"Use json":
0.0022 msecs per iteration (total: 75, iterations: 32768)
PASS : TestQgsJsonUtils::testExportAttributesJson(Use old string concat)
RESULT : TestQgsJsonUtils::testExportAttributesJson():"Use old string concat":
0.0032 msecs per iteration (total: 54, iterations: 16384)
PASS : TestQgsJsonUtils::testExportFeatureJson(Use json)
RESULT : TestQgsJsonUtils::testExportFeatureJson():"Use json":
0.011 msecs per iteration (total: 96, iterations: 8192)
PASS : TestQgsJsonUtils::testExportFeatureJson(Use old string concat)
RESULT : TestQgsJsonUtils::testExportFeatureJson():"Use old string concat":
0.015 msecs per iteration (total: 64, iterations: 4096)
PASS : TestQgsJsonUtils::testExportGeomToJson(Use json)
RESULT : TestQgsJsonUtils::testExportGeomToJson():"Use json":
0.76 msecs per iteration (total: 98, iterations: 128)
PASS : TestQgsJsonUtils::testExportGeomToJson(Use old string concat)
RESULT : TestQgsJsonUtils::testExportGeomToJson():"Use old string concat":
0.85 msecs per iteration (total: 55, iterations: 64)
PASS : TestQgsJsonUtils::cleanupTestCase()
This library, original taken from https://github.com/sijk/qt-unix-signals
(but a maintained fork exists at https://github.com/nyalldawson/qt-unix-signals),
handles unix signal watching using the Qt libraries.
It allows for detection of signals like SIGINT and SIGTERM,
and allows Qt applications to respond gracefully to these.
Included in external libraries for use in QGIS terminal
applications.
Even preventing their output isn't enough here. There's just
SO many debug msgs throughout this class, that creating and
parsing the debug messages strings (which is done even if
the message level is higher than is output) is enough
to grind the import to a halt on debug enabled builds.
std::move should not be used here because
it prevents RVO (copy elision) and it's
considered an anti-pattern.
To fix the original warning the returned
type must match the declared return
type or copy elision will not be possible
(and the warning will be triggered).
CL/cl2.hpp, which the OpenCL support is based upon, is not always
included with OpenCL on some platforms, e.g. Mac, or not readily
available as a package. This work adds a CMake module specifically for
finding cl2.hpp, as installed by OpenCL-CLHPP project.
If not found, but standard OpenCL lib and headers are, the vendored
cl2.hpp in external/opencl-clhpp is used, as it needs no compilation.
- Only the cl2.hpp, license and README are vendored from OpenCL-CLHPP.
- Fix up referenced includes in other CMake targets, to ensure the
includes for OpenCL are specifically added (previously, they were
sometimes found in existing include directories of other dependencies).
- Fixup for standard FindOpenCL module not assinging proper framework
headers directory for Mac.