neuron-explorer
Qwen3.5‑4B 전용 조향형 뉴런 탐색기, 모든 MLP 뉴런을 밀어 결과를 보관·탐색
simdjson의 Rust 포트
Rust port of simdjson
개발 도구Rust · DockerfileGitHub @simd-lite직접 설치운영자 미확인
써 보셨어요? 한 번만 눌러 주세요. 로그인은 필요 없어요.
아직 감지된 업데이트가 없습니다. GitHub 릴리스가 나오면 여기에 보입니다.
개인 계정의 공개 저장소 소유자는 GitHub로 로그인해 운영자를 확인하고 소개를 직접 관리할 수 있습니다. 관리자 승인은 필요하지 않습니다.
로그인한 뒤 확인 파일을 만들어 이 저장소의 기본 브랜치에 30분 안에 커밋해 주세요. 다른 브랜치나 포크의 파일은 인정하지 않습니다. 파일을 올린 뒤 아래에서 확인하면 관리자 승인 없이 관리할 수 있습니다. 자격을 유지하려면 파일을 남겨 두세요.
로그인이 필요하면 로그인 화면으로 이동합니다. 로그인 후 이곳으로 돌아와 원하는 확인 버튼을 다시 눌러 주세요.
설치형 프로젝트는 배포 도메인 없이도 확인할 수 있습니다. 개인 저장소는 GitHub 로그인으로, 조직 저장소는 위의 저장소 확인 파일로 직접 확인해 주세요.
메이커가 쓴 소개는 위의 한 줄이 전부입니다. 더 자세한 내용은 저장소 README에서 읽을 수 있습니다. 저장소 README ↗
README 전체를 불러오는 중입니다.
README 전문 보기 ↗Rust port of extremely fast simdjson JSON parser with Serde compatibility.
simd-json is a Rust port of the simdjson c++ library. It follows most of the design closely with a few exceptions to make it better fit into the Rust ecosystem.
The goal of the Rust port of simdjson is not to create a one-to-one copy, but to integrate the principles of the C++ library into a Rust library that plays well with the Rust ecosystem. As such we provide both compatibility with Serde as well as parsing to a DOM to manipulate data.
As a rule of thumb this library tries to get as close as possible to the performance of the C++ implementation (currently tracking 0.2.x, work in progress). However, in some design decisions—such as parsing to a DOM or a tape—ergonomics is prioritized over performance. In other places Rust makes it harder to achieve the same level of performance.
To take advantage of this library your system needs to support SIMD instructions. On x86, it will
select the best available supported instruction set (avx2 or sse4.2) when the runtime-detection feature
is enabled (default). On aarch64 this library uses the NEON instruction set. On wasm this library uses
the simd128 instruction set when available. When no supported SIMD instructions are found, this library will use a
fallback implementation, but this is significantly slower.
For best performance, we highly suggest using snmalloc, mimalloc or jemalloc instead of the system default allocator.
simd-json uses a lot of unsafe code.
There are a few reasons for this:
simd-json.simd-json.simd-json goes through extra scrutiny for unsafe code. These steps are:
simd-json
codebase stochastically. Floats are currently excluded since slightly different parsing algorithms lead to slightly
different results here. In short "is simd-json correct".This doesn't ensure complete safety nor is at a bulletproof guarantee, but it does go a long way to assert that the library is of high production quality and fit for purpose for practical industrial applications.
Various features can be enabled or disabled to tweak various parts of this library. Any features not mentioned here are for internal configuration and testing.
runtime-detection (default)This feature allows selecting the optimal algorithm based on available features during runtime. It has no effect on
non-x86 platforms. When neither AVX2 nor SSE4.2 is supported, it will fall back to a native Rust implementation.
Disabling this feature (with default-features = false) and setting RUSTFLAGS="-C target-cpu=native will result
in better performance but the resulting binary will not be portable across x86 processors.
serde_impl (default)Enable Serde support. This consist of implementing serde::Serializer and serde::Deserializer,
allowing types that implement serde::Serialize/serde::Deserialize to be constructed/serialized to
BorrowedValue/OwnedValue.
In addition, this provides the same convenience functions that serde_json provides.
Disabling this feature (with default-features = false) will remove serde and serde_json from the dependencies.
swar-number-parsing (default)Enables a parsing method that will parse 8 digits at a time for floats. This is a common pattern but comes at a slight performance hit if most of the float have less than 8 digits.
known-keyThe known-key feature changes the hash mechanism for the DOM representation of the underlying JSON object from
ahash to fxhash. The ahash hasher is faster at hashing and provides protection against DOS attacks by forcing
multiple keys into a single hashing bucket. The fxhash hasher allows for repeatable hashing results,
which in turn allows memoizing hashes for well known keys and saving time on lookups. In workloads that are heavy on
accessing some well-known keys, this can be a performance advantage.
The known-key feature is optional and disabled by default and should be explicitly configured.
big-int-as-floatThe big-int-as-float feature flag treats very large integers that won't fit into u64 as f64 floats. This prevents
parsing errors if the JSON you are parsing contains very large integers. Keep in mind that f64 loses some precision when
representing very large numbers.
128bitAdd support for parsing and serializing 128-bit integers. This feature is disabled by default because such large numbers are rare in the wild and adding the support incurs a performance penalty.
beefEnabling this feature can break dependencies in your dependency tree that are using simd-json.
Replace std::borrow::Cow with
beef::lean::Cow This feature is disabled by default, because
it is a breaking change in the API.
ordered-floatBy default the representation of Floats used in borrowed::Value and owned::Value is simply a value of f64.
This however has the normally-not-a-big-deal side effect of not having these Value types be std::cmp::Eq. This does,
however, introduce some incompatibilities when offering simd-json as a quasi-drop-in replacement for serde-json.
So, this feature changes the internal representation of Floats to be an f64 wrapped by an Eq-compatible adapter.
This probably carries with it some small performance trade-offs, hence its enablement by feature rather than by default.
portableCurrently disabled
An highly experimental implementation of the algorithm using std::simd and up to 512 byte wide registers.
simd-json offers three main entry points for usage:
The values API is a set of optimized DOM objects that allow parsed
JSON to JSON data that has no known variable structure. simd-json
has two versions of this:
Borrowed Values
use simd_json;
let mut d = br#"{"some": ["key", "value", 2]}"#.to_vec();
let v: simd_json::BorrowedValue = simd_json::to_borrowed_value(&mut d).unwrap();
Owned Values
use simd_json;
let mut d = br#"{"some": ["key", "value", 2]}"#.to_vec();
let v: simd_json::OwnedValue = simd_json::to_owned_value(&mut d).unwrap();
use simd_json;
use serde_json::Value;
let mut d = br#"{"some": ["key", "value", 2]}"#.to_vec();
let v: Value = simd_json::serde::from_slice(&mut d).unwrap();
use simd_json;
let mut d = br#"{"the_answer": 42}"#.to_vec();
let tape = simd_json::to_tape(&mut d).unwrap();
let value = tape.as_value();
// try_get treats value like an object, returns Ok(Some(_)) because the key is found
assert!(value.try_get("the_answer").unwrap().unwrap() == 42);
// returns Ok(None) because the key is not found but value is an object
assert!(value.try_get("does_not_exist").unwrap() == None);
// try_get_idx treats value like an array, returns Err(_) because value is not an array
assert!(value.try_get_idx(0).is_err());
There are also bindings for upstream simdjson available here
simd-json itself is licensed under either of
at your option.
However it ports a lot of code from simdjson so their work and copyright on that should also be respected.
The Serde integration is based on serde-json so their copyright should as well be respected.