John Keiser
bbd61eb13f
Let tape writing be put in a register
2020-06-12 09:18:20 -07:00
Daniel Lemire
a6e4933d93
Exposing the string minifier.
2020-06-11 13:07:18 -04:00
John Keiser
fe01da077e
Make threaded version work again
2020-06-07 16:21:00 -07:00
John Keiser
d43a4e9df9
Remove SUCCESS_AND_HAS_MORE (internal only value)
2020-06-07 16:20:55 -07:00
John Keiser
ef63a84a3e
Move document stream state to implementation
2020-06-07 16:20:44 -07:00
Daniel Lemire
7a69da16e4
Fixing issue 906 ( #912 )
...
* Fixing issue 906
* Safe patching.
* Now with explanations.
* Bumping up memory allocation.
* Putting the patch back.
* fallback fixes.
Co-authored-by: Daniel Lemire <lemire@gmai.com>
2020-06-05 15:37:09 -04:00
John Keiser
b75fa26dc1
Move containing_scope and ret_address to .cpp
2020-06-01 12:15:55 -07:00
John Keiser
3d22a2d845
One weird trick: set a bogus error value in the parser impl
...
This makes us faster under both gcc and clang somehow.
2020-06-01 12:15:55 -07:00
John Keiser
1aab4752e2
Store all parser state in the implementation
2020-06-01 12:15:54 -07:00
John Keiser
6a71b24495
Reuse stored buf and len from parser
2020-06-01 12:14:09 -07:00
John Keiser
a3a9bde83e
Move DOM parsing into concrete interface implementation
2020-06-01 12:14:09 -07:00
Daniel Lemire
40d57da83c
fixes issue 891 ( #893 )
2020-05-20 11:54:53 -04:00
John Keiser
e6c9dfbd91
Make include files more fine-grained
2020-05-19 14:42:04 -07:00
John Keiser
7ad4020829
Make main compilation chunks into .cpp files
2020-05-19 13:32:35 -07:00
John Keiser
a476531524
Share ref_address everywhere it's used
2020-05-19 13:30:34 -07:00
Daniel Lemire
e03c5e9f23
We should guard the include ( #881 )
2020-05-13 20:02:46 -04:00
John Keiser
dbb3316511
Move current_string_buf_loc to stage 2
2020-05-11 06:11:32 -07:00
John Keiser
cd6f204c77
Move write_tape() to stage 2 code
2020-05-11 06:09:48 -07:00
John Keiser
269131ed21
Move on_number_* to stage 2 code
2020-05-11 06:04:54 -07:00
John Keiser
65d784e88e
Move on_start/end_string to stage 2 code
2020-05-11 05:49:40 -07:00
John Keiser
35afb6cae0
Move on_error, on_success to stage 2 code
2020-05-11 05:46:18 -07:00
John Keiser
4f25b6ac0c
Move on_end_* to stage 2 code
2020-05-11 05:34:49 -07:00
John Keiser
3d5ed1a7e3
Move on_start_* to stage 2 code
2020-05-11 05:30:35 -07:00
John Keiser
a03115a4a6
Move end_scope to stage 2 code
2020-05-11 05:24:12 -07:00
John Keiser
7219d28a31
Call end_scope directly from stage 2 code
2020-05-11 05:20:04 -07:00
John Keiser
0875bce68f
Don't pass depth to on_end_*
2020-05-11 05:15:39 -07:00
John Keiser
54fe302907
Don't pass depth to end_scope
2020-05-11 05:06:41 -07:00
John Keiser
edaa8f811f
Move on_start_* depth management to stage 2 code
2020-05-11 05:03:25 -07:00
John Keiser
2c8fd109de
Move increment_count to stage 2
2020-05-11 04:58:50 -07:00
John Keiser
16d88cc095
Don't pass depth to increment_count
2020-05-11 04:15:02 -07:00
Daniel Lemire
2a6e6b3dbd
Cleaning string_view ( #872 )
...
* Cleaning string_view
* Corrected typo
* Alignment.
2020-05-10 16:05:52 -04:00
John Keiser
afb369950c
Disable Intellisense-only warnings in simdjson.h/cpp
2020-05-04 11:47:04 -07:00
John Keiser
1d06624d38
Unset /D_CRT_SECURE_NO_WARNINGS
...
- Also localize DISABLE_DEPRECATED_WARNING so that we catch other
deprecations
2020-05-04 11:35:05 -07:00
Pavel P
d40069a018
Disable deprecation warnings for VS builds
...
fopen/getenv are standard c++ that are not deprecated.
2020-05-04 11:34:00 -07:00
Furkan Usta
e04cbd71d0
Only install singleheader/simdjson.h as part of the public API
2020-05-02 01:44:11 +03:00
Daniel Lemire
fc1ddcd2f8
Faster case-insensitive comparisons. ( #837 )
...
* Faster case-insensitive comparisons.
2020-04-30 15:52:28 -04:00
Furkan Usta
73d7d704c1
CMake: Remove export_private_library
...
Since we are exporting all the targets as part of the main simdjson target we do not need private
exports anymore
2020-04-30 02:06:19 +03:00
Furkan Usta
eee07e6cfd
Use the same export name for all targets
2020-04-29 23:47:27 +03:00
Nong Li
0f9dbf84b7
Fix incorrect check for case insensitive key lookup ( #824 )
2020-04-29 13:55:28 -04:00
Daniel Lemire
2a1f8fa8f1
Provides support for clang under Windows. ( #817 )
2020-04-27 22:09:27 -04:00
John Keiser
49da7e74cd
usage.md -> basics.md ( #823 )
2020-04-27 16:03:19 -04:00
PavelP
0514588175
Improves clang-cl build with Visual Studio ( #809 )
2020-04-27 08:59:32 -04:00
Daniel Lemire
b99a7344c9
missing spaces.
2020-04-25 22:26:18 -04:00
Daniel Lemire
f3ac0be0e6
Merge branch 'master' of github.com:simdjson/simdjson
2020-04-23 18:39:56 -04:00
Daniel Lemire
18c9468af5
Fixed typo
2020-04-23 18:39:32 -04:00
ostri
d4239aaa8f
default initialisaiton ( #779 )
...
* padded_string.* default initialisation
parsedjson_iterator - copy constructor; depth_index not necessary
2020-04-23 18:32:11 -04:00
Daniel Lemire
4d0c7d706d
Warn 32-bit users about their doom. ( #783 )
2020-04-23 16:01:19 -04:00
Daniel Lemire
382392e03b
This should enable -Weffc++ ( #777 )
...
* Enabling -Weffc++
2020-04-23 13:03:04 -04:00
Daniel Lemire
0d1c574cb1
A few more changes... ( #775 )
...
* More nitpicking.
2020-04-23 11:36:52 -04:00
ostri
87acab0846
elimination of most of g++ -Weffc++ warnings ( #764 )
...
Co-authored-by: Matjaž Ostroveršnik <ostri@localhost.localdomain>
Co-authored-by: Daniel Lemire <lemire@gmail.com>
2020-04-23 10:06:44 -04:00
Daniel Lemire
e030f02776
Merge branch 'master' into jkeiser/wconversion
2020-04-22 22:03:34 -04:00
Daniel Lemire
185274e70f
Let us see if we can test with libc++. ( #732 )
...
* Let us see if we can test with libc++.
* Fixed spacing.
2020-04-22 21:24:42 -04:00
John Keiser
d4a37f6ef5
Enable conversion warnings on Linux and Windows
2020-04-22 14:21:30 -07:00
John Keiser
3e9e14f4d6
Reenable deprecation warnings on Windows
2020-04-22 08:53:19 -07:00
John Keiser
289cc3e7a0
Treat warnings as errors during compilation
2020-04-15 19:59:38 -07:00
John Keiser
7480b87e07
Merge pull request #693 from simdjson/jkeiser/cmake-quickstartcpp
...
Add C++11 tests to cmake
2020-04-15 19:53:14 -07:00
Daniel Lemire
befa6423be
This massively improves the performance of tight loops relying on a type() call. ( #721 )
...
* This massively improves the performance of tight loops relying on a type() call.
* Adding a few more benchmarks
2020-04-15 20:45:40 -04:00
John Keiser
fd418f568c
Fix c++11 warnings on clang
...
- namespace x::y is C++17
- static_assert requires message in C++11
2020-04-15 17:27:48 -07:00
John Keiser
09cf18a646
Add C++11 tests to cmake
...
- Add simdjson-flags target so callers don't have flags forced on them
2020-04-15 17:26:25 -07:00
Daniel Lemire
326c175dcb
Massive performance boost for get<double>. ( #719 )
...
* Massive performance boost for get<double>.
2020-04-15 20:09:45 -04:00
Daniel Lemire
6d7c77ddc1
Let us try to check with the exceptions disabled. ( #707 )
...
* Tweaking code so that we can run all tests with exceptions off.
* Removing SIMDJSON_DISABLE_EXCEPTIONS
2020-04-15 16:45:36 -04:00
Daniel Lemire
b523c43927
Can we provide a size() function to arrays and objects? (eager approach) [TO BE MERGED] ( #690 )
...
* This is an implementation of "size()" for arrays and objects.
* Adding benchmark
* Adding a size() remark in the documentation.
* Extending size() to result types.
2020-04-15 10:15:48 -04:00
Paul Dreik
75545ff70d
ref qualify parser methods to avoid use of dangling objects ( #703 )
...
To avoid using data belonging to a temporary, the parse functions are ref qualified to get a compile error if used on an rvalue. See https://github.com/simdjson/simdjson/issues/696
Compilation tests are also added, to make sure bad usage fails to compile.
Reviewed by jkeiser.
2020-04-15 09:57:52 +02:00
Daniel Lemire
8539896f3d
It is inconvenient to be unable to print a padded_string. ( #713 )
...
* It is inconvenient to be unable to print a padded_string.
* Allows us to print the padded_string even when it is embedded in result object when exceptions are enabled.
2020-04-14 19:07:32 -04:00
Daniel Lemire
334a486737
Tweaking the doxygen. ( #700 )
...
* Tweaking the doxygen.
* Fixing typo.
2020-04-14 11:31:46 -04:00
Daniel Lemire
4af7d6f108
Disabling threads on apple's hardware when optimizer is turned off ( #692 )
...
* Disabling threads on apple's hardware.
* Turns out that you can have your bread, your butter and you cake too!
2020-04-10 18:41:05 -04:00
John Keiser
6835dd73bc
Only apply compile flags to simdjson
2020-04-09 08:52:29 -07:00
John Keiser
54b7291c34
Reference simdjson by name, don't specify include files individually
2020-04-08 14:52:55 -07:00
John Keiser
1e30b6e334
Compile under C++ 11
2020-04-08 14:00:13 -07:00
John Keiser
406240bae3
Support C++ 14
2020-04-08 14:00:13 -07:00
Dirk Eddelbuettel
12ed6336b1
remove three trailing semicolons that -pedantic dislikes ( #673 )
2020-04-02 21:06:25 -04:00
Daniel Lemire
3cb79e6977
Trying again. ( #671 )
2020-04-02 19:24:43 -04:00
John Keiser
13aee51011
Add element.type() for type switching
2020-04-02 14:07:19 -07:00
Daniel Lemire
3116e29d16
Release candidate ( #655 )
...
* Release candidate
2020-03-31 17:47:25 -04:00
John Keiser
d93af1161d
Remove set_capacity, replace with allocate
...
Makes allocation point more predictable
2020-03-30 13:49:54 -07:00
John Keiser
434776db1a
Deprecate more things
2020-03-30 13:48:43 -07:00
John Keiser
6167e9cefc
Update doxygen to not show deprecated/private things
2020-03-30 13:47:27 -07:00
John Keiser
dc918d764e
Merge pull request #646 from simdjson/jkeiser/quickstart-example
...
Compile all .md examples in CI
2020-03-30 13:44:43 -07:00
John Keiser
7656bd50ee
Generate API docs at /api/docs
2020-03-29 17:01:12 -07:00
John Keiser
7ed65e42d7
Add actual examples from basics.md to readme_examples
2020-03-29 16:28:29 -07:00
John Keiser
ea8a5020e2
Remove array indexer, make object indexer key lookup
2020-03-28 15:56:43 -07:00
John Keiser
622d9c9480
Replace as_X and is_X with get<T> and is<T>
2020-03-28 15:29:53 -07:00
John Keiser
62da98aef6
Rename dom::stream to dom::document_stream
2020-03-28 13:42:24 -07:00
John Keiser
03746b966b
Move document/element/etc. under dom
2020-03-28 13:42:21 -07:00
John Keiser
836e1fc330
Use simdjson_result for all _result classes
2020-03-28 12:03:05 -07:00
John Keiser
e836c28008
Deprecate parser error code methods
...
- Also make competitions compile without warnings
2020-03-28 10:13:20 -07:00
John Keiser
748df8d109
Use string_view instead of string/char* where possible
2020-03-27 13:11:41 -07:00
John Keiser
5ad405006c
Return document::element from parse, load, parse_many, load_many
2020-03-27 12:24:41 -07:00
John Keiser
e3efbcddc1
Cast padded_string to string_view instead of string
2020-03-27 09:13:11 -07:00
John Keiser
c14b2fb36c
Remove const char* variants for at_key()
...
- Remove const char * variants for at_key(), string_view covers them
- Add at_key_case_insensitive variants on *_result
- Add at(), at_key(), at_key_case_insensitive() tests
2020-03-27 09:09:08 -07:00
John Keiser
f0f111b387
Make ParsedJson::Iterator backcompat test
2020-03-27 09:07:39 -07:00
Daniel Lemire
abb0bf9247
Fixed basictests
2020-03-26 19:40:29 -04:00
John Keiser
56841bcede
Fix conversion error on Windows
2020-03-26 12:48:07 -07:00
John Keiser
006cc2ed60
Remove simdjson_move_result
2020-03-26 12:48:03 -07:00
John Keiser
2e420169c3
Remove document::parse and document::load
2020-03-26 10:13:09 -07:00
John Keiser
5aec2671ea
Remove JsonStream. Use parse_many() instead.
2020-03-26 09:25:07 -07:00
John Keiser
06587824be
Deprecate ParsedJson::Iterator
2020-03-25 18:26:51 -07:00
John Keiser
a0bce440a6
Remove document_iterator, document::iterator, ParsedJsonIterator
...
Keep ParsedJson::Iterator only, without template, in same form as
it was in 0.2
2020-03-25 18:26:51 -07:00
Daniel Lemire
8769e42a56
Fixes issue 600 ( #614 )
...
* Fixes issue 600
2020-03-25 18:01:23 -04:00
John Keiser
7cde65aa6e
This deprecates json_parse() and build_parsed_json().
2020-03-25 14:19:24 -07:00
John Keiser
e1b1500e3b
Make _padded available without using namespace simdjson
2020-03-25 09:37:18 -07:00
John Keiser
b28cafc1d1
Remove backslash unescaping from JSON pointer impl
...
Also speed up non-escaped key lookup
2020-03-25 08:56:40 -07:00
John Keiser
0bcda5e384
Support JSON pointer in DOM navigation model
2020-03-23 15:05:20 -07:00
Daniel Lemire
3e39a998ce
Merge branch 'master' of github.com:lemire/simdjson
...
Conflicts:
include/simdjson/jsonstream.h
2020-03-22 12:40:34 -04:00
Daniel Lemire
2867dc50fa
Minor typo.
2020-03-22 12:39:01 -04:00
Bruce Mitchener
c3c43769ae
Fix typos.
2020-03-22 09:14:14 -07:00
John Keiser
36ceaa4452
Keep loaded_bytes in parser to reduce allocation
...
Also centralized memory ownership to make it easy to keep data around
2020-03-21 18:12:16 -07:00
John Keiser
e8b3f9eaad
Support document::parse("[1,2,3]"_padded)
2020-03-21 11:15:20 -07:00
Daniel Lemire
5d1e3efce8
faster minifier ( #568 )
...
* Fallback should use our scalar code.
* parse should have a nicer error message.
* Making it so that "minify" can use different architectures.
* Let us change the minifier competition so that it tests all implementations.
* Documenting the untaken optimization opportunity.
Co-authored-by: John Keiser <john@johnkeiser.com>
2020-03-20 16:14:47 -04:00
Daniel Lemire
6cefeb338b
std::tie does not work on some compilers ( #567 )
...
* std::tie workaround.
* Cleaner solution
2020-03-19 16:56:45 -04:00
John Keiser
5a071c1907
Remove TARGET_FALLBACK
2020-03-17 14:59:47 -07:00
John Keiser
7cf3a7511b
Add fallback implementation to CI
...
- Also add SIMDJSON_IMPLEMENTATION_HASWELL/WESTMERE/ARM64/FALLBACK=1/0 to
enable/disable various implemnentations
2020-03-17 14:59:47 -07:00
John Keiser
af203aaf86
Add fallback parser for pre-SSE4.2 machines
2020-03-17 14:59:47 -07:00
John Keiser
8e2c06cb0e
Compile with -fno-exceptions
2020-03-17 13:54:37 -07:00
John Keiser
1a5d8f1957
Add tests for SIMDJSON_EXCEPTIONS=0, add `tie()` support
2020-03-17 13:54:37 -07:00
John Keiser
03c828c7ad
Add SIMDJSON_EXCEPTIONS=ON to turn on exception interface
2020-03-17 13:54:37 -07:00
John Keiser
acc7bd79b0
Support cout << json, cout << minify(json)
2020-03-13 18:59:15 -07:00
Daniel Lemire
89d9de2353
Adding a check to see whether document::stream copy constructor and assignment actually compile ( #556 )
...
* Currently, document::stream contains an attribute that is a reference:
```
document::parser &parser;
```
Yet we try to have it default on the move operator:
```
stream &operator=(document::stream &&other) = default;
stream &operator=(const document::stream &) = delete; // Disallow copying
```
```
stream(document::stream &&other) = default;
stream(const document::stream &) = delete; // Disallow copying
```
I am not sure what the move is supposed to do with the reference.
I cannot find where we test the copy constructor and assignment. This has been concerned that it is either dead code or buggy code.
* Remove non-working, unnecessary move constructors
* We still want to disallow copies.
Co-authored-by: John Keiser <john@johnkeiser.com>
2020-03-13 12:53:42 -04:00
John Keiser
a5afec1f94
Make #defines into simdjson::constants
2020-03-11 19:16:29 -07:00
John Keiser
ac0899c043
Add error tests, doc_ref_result[] chaining
2020-03-11 17:19:41 -07:00
John Keiser
40c6213d7e
Add parser.load() and load_many() to load files
2020-03-11 17:19:41 -07:00
John Keiser
d140bc23f5
Automatically allocate memory as needed in parse
2020-03-11 16:14:54 -07:00
John Keiser
66a2807210
Rename invalid_json to simdjson_error
2020-03-06 16:12:51 -08:00
John Keiser
3bdfe167de
Support cout << error
2020-03-06 15:41:51 -08:00
John Keiser
31e8a12e88
Make error_message(error_code) return C string
...
- Also move all error message logic to include inline
2020-03-06 15:41:51 -08:00
John Keiser
9a7c8fb5be
Use parse_many in examples/tests/docs
2020-03-05 12:04:45 -08:00
John Keiser
cfef4ff2ad
Create parser.parse_many() API
2020-03-05 12:04:45 -08:00
John Keiser
1c922d3b73
Fix JsonStream reference to parser on_error
2020-03-04 14:26:54 -08:00
John Keiser
b23dd28a06
Declare functions inline to surface "undefined" errors earlier
2020-03-04 14:26:54 -08:00
John Keiser
a55f41a24a
Move JsonStream inline implementation to inline .h
2020-03-04 14:26:54 -08:00
John Keiser
5525c6f729
Stop using jsoncharutils.h in JsonStream
2020-03-04 14:26:54 -08:00
John Keiser
eb147d9868
Mark jsonformatutils.h/isadetection.h internal
...
- Move jsonformatutils.h to internal/jsonformatutils.h (it is used by
document::print_json)
- Move isadetection.h to src/ (it is only used internally)
2020-03-04 14:26:54 -08:00
John Keiser
f58a5d534e
Move parser inline implementation to .cpp
2020-03-04 14:26:54 -08:00
John Keiser
b3ea8c406e
Add simdjson.cpp for unified use ( #515 )
2020-03-04 10:12:27 -08:00
John Keiser
99667f7c55
Create top level simdjson.h ( #515 )
...
- Allows everyone to #include the same way, singleheader or not.
2020-03-04 10:12:27 -08:00
John Keiser
0b21203141
Document navigation API
2020-03-02 14:49:03 -08:00
John Keiser
910f272467
Add parser implementation interface and selection API ( #501 )
...
* Make architecture implementations virtual functions
- Easier to add new architectures (add implementation to implementation.cpp)
- Easier to add new algorithms / functions to architecture selection
(add to implementation.h, implement)
- Automatically select best implementation in static initialization
- Allow user to explicitly select implementation with a string (i.e.
parameter)
- Allow user to inspect current implementation name/description
- Allow user to list available implementations
- Eliminate architecture enum and architecture-based templating
- Add noexcept in non-inline functions
* Move implementation static methods to their own classes
* Detect best supported implementation on first use
* available_implementationsI() -> available_implementations
2020-02-21 16:34:27 -05:00
John Keiser
1f76737510
Make valstat-ish parse APIs
2020-02-18 08:37:07 -08:00
John Keiser
bc8bc7d1a8
Lowercase Architecture and ErrorValues ( #487 )
...
ErrorValues -> error_code, Architecture -> architecture
2020-02-14 15:21:28 -08:00
Daniel Lemire
083569fca8
This code is terrible and should not be there. ( #496 )
2020-02-13 07:38:11 -05:00
John Keiser
8e7d1a5f09
Separate document state from ParsedJson
...
This creates a "document" class with only user-facing document state (no parser internals).
- document: user-facing document state
- document::iterator: iterator (equivalent of ParsedJsonIterator)
- document::parser: parser state plus a "docked" document we parse into (equivalent of ParsedJson)
Usage:
```c++
auto doc = simdjson::document::parse(buf, len); // less efficient but simplest
```
```c++
simdjson::document::parser parser; // reusable parser
parser.allocate_capacity(len);
simdjson::document* doc = parser.parse(buf, len); // pointer to doc inside parser
doc = parser.parse(buf2, len); // reuses all buffers and overwrites doc; more efficient
```
2020-02-07 10:02:36 -08:00
John Keiser
76c706644a
Move stage 2 tape writing to ParsedJson ( #477 )
...
This is a first step to allowing alternate tape formats.
2020-02-04 14:28:42 -08:00
Daniel Lemire
c924aaede9
Fix issue472: make JsonStream a template. ( #473 )
...
* Fix issue472: make JsonStream a template.
* Adding missing include.
* Tweaking headers and some minor formatting.
* Removing file from aggregation.
* Moving jsoncharutils
* Adding new header.
* Trying another header.
* Let us try to route around Visual Studio's nonesense.
2020-01-30 17:16:41 -05:00
Daniel Lemire
28710f8ad5
fix for Issue 467 ( #469 )
...
* Fix for issue467
* Updating single-header
* Let us make it so that JsonStream is constructed from a padded_string which will avoid dangerous overruns.
* Fixing parse_stream
* Updating documentation.
2020-01-29 19:00:18 -05:00
Daniel Lemire
e695a19d11
Trying to fix issue 465 ( #466 )
...
* Trying to fix issue 465
* Actually testing
* Refreshing amal.
* Removing spurious ;
2020-01-27 11:25:23 -05:00
Daniel Lemire
ba14232628
Fixing mem leak. ( #461 )
2020-01-27 09:31:12 -05:00
Daniel Lemire
3488c49d0a
Basically, haswell processor should be able to count on lzcnt. ( #458 )
2020-01-22 16:52:55 -05:00
Daniel Lemire
ce8fe1bdf6
This isolates a fix found in the large PR https://github.com/lemire/simdjson/pull/445 ( #457 )
2020-01-22 12:58:59 -05:00
Daniel Lemire
fa04595d90
Correcting typo.
2020-01-22 11:08:53 -05:00
Daniel Lemire
80b4dd2e8a
Removing all stdout, stderr from main library. ( #455 )
...
* Removing all stdout,stderr from main library.
2020-01-20 16:03:15 -05:00