luizperes / simdjson_nodejs

Node.js bindings for the simdjson project: "Parsing gigabytes of JSON per second"
https://arxiv.org/abs/1902.08318
Apache License 2.0
549 stars 25 forks source link

a idea to enhance simdjson.parse performance #67

Open theweipeng opened 1 year ago

theweipeng commented 1 year ago

hello, I find that the simdjson.parse is very slow. i think if your use napi to create string, nodejs would copy the string bytes. the bestway to create string is use v8's String.substring, which would create a sliceString in v8 that no need copy memory. simdjson can generate a new buffer, and use javascript to constructe the json object via the buffer.