Comments (2)
We now have a scalar minifier that looks like this:
static inline size_t despace(const unsigned char *bytes, size_t howmany,
unsigned char *out) {
size_t i = 0, pos = 0;
uint8_t quote = 0;
uint8_t nonescape = 1;
while (i < howmany) {
unsigned char c = bytes[i];
uint8_t *meta = jump_table + 3 * c;
quote = quote ^ (meta[0] & nonescape);
out[pos] = c;
pos += meta[2] | quote;
i += 1;
nonescape = (~nonescape) | (meta[1]);
}
return pos;
}
It handles quotes, escapes... it is uglier than I'd like but not unlike what an engineer could write.
from simdjson.
This provides some kind of validation of the AVX-based minifier.
from simdjson.
Related Issues (20)
- Significant size increase for single header files HOT 6
- No consistant coding style in docs HOT 1
- No consistant coding style in docs - clarification HOT 1
- Need help parsing an array of objects HOT 10
- Linker error unresolved external symbol simdjson::internal::error_code_info HOT 1
- Build shared and static libraries HOT 1
- array::at() method returns INDEX_OUT_OF_BOUNDS HOT 5
- Add full support for JSONPath HOT 19
- 你能训练一个连下2步的围棋ai吗?
- Trailing comma support for array and object HOT 1
- Confusing error message when trying to convert a non-scalar on-demand document to a value HOT 2
- Add Glace to the benchmarks HOT 1
- Double parsing can produce incorrect results due to integer overflow. HOT 1
- get_number().get_double() produces incorrect results, but get_double() is correct HOT 1
- unsafe precondition(s) violated: ptr::write requires that the pointer argument is aligned and non-null HOT 1
- [SOLVED] ambiguous template specialization 'get<simdjson::fallback::ondemand::document>' HOT 2
- How can I fix 'simdjson::dom::parser::Iterator::is_object': Use the new DOM navigation API instead (see doc/basics.md)' compiler warning in VS2019? HOT 1
- Implement an ability to parse integers that exceed 64 bits HOT 11
- Does this library only support the read operations? I have seen some APIs that do not seem to support the write operations similar to rapidjson. HOT 1
- Branchless integer parsing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from simdjson.