Pars JSON data in JS, how faster?

Get json data from a websocket, they party put the condition, it is possible with some plugins or other additives to make the process faster (mean speed up Pars data), or native function is the fastest that can be?

In fact understand it needs to be native the fastest, because they do 1mu condition, and the remaining plugins will do multiple actions
March 23rd 20 at 19:10
2 answers
March 23rd 20 at 19:12
Solution
the native function is the fastest that can be?
Yes
and in comparison with other languages, like c#, python, c++ and other speed will be the same? Mean the same actions that Pars JSON data - Roderick_Eichmann30 commented on March 23rd 20 at 19:15
@Roderick_Eichmann30,
No idea
And what do you care? - Alfreda83 commented on March 23rd 20 at 19:18
@Alfreda83need every hundredth of milliseconds, if not the tenth. But thank you very much for the reply - Roderick_Eichmann30 commented on March 23rd 20 at 19:21
@Roderick_Eichmann30, no, not important - Alfreda83 commented on March 23rd 20 at 19:24
@Alfreda83, trust is important. Because my next action is sending a post request to which the server responds. If there is a delay of a couple of hundred milliseconds, will I last submitted the request. It would be worthwhile to ask, not to write, look me up, one of your options) - Roderick_Eichmann30 commented on March 23rd 20 at 19:27
@Roderick_Eichmann30, then GS is not your PL
Then post the server you have at the site of the donor
Then you need to have experience in writing such applications

Because there is no
You unimportant MS - Alfreda83 commented on March 23rd 20 at 19:30
@Alfreda83, actually the script on the VPS. I tried to do everything through python and c# (in the same naive function) and the time was +- the same in a few milliseconds. The experience you get at the moment, if there is an example of literature would be very grateful. The script node is written - Roderick_Eichmann30 commented on March 23rd 20 at 19:33
@Roderick_Eichmann30,

If it is about fast trading, you need java, c++, asm
Manuals for beginners in such a case there is

In any case, you need to know how to measure the time the code works, to have a concept about the timings of the treatment to the caches, the CPU, RAM, disk and network - Alfreda83 commented on March 23rd 20 at 19:36
@Alfreda83, I am very very sorry. But I have a second maximum can not fly more than 100 objects, are imposed on 10-20 conditions, do I still have to get deeper into c++, because in fact, these operations should be delayed a couple of milliseconds (compared with Noda), or am I very much mistaken? - Roderick_Eichmann30 commented on March 23rd 20 at 19:39
@Roderick_Eichmann30if
important every hundredth of milliseconds
then
will have to delve into learning c++
- Alfreda83 commented on March 23rd 20 at 19:42
@Alfreda83, well, thank you so much for such valuable advice) - Roderick_Eichmann30 commented on March 23rd 20 at 19:45
March 23rd 20 at 19:14
const json = `{
 "type": "widget-chart",
 "title": "Handcrafted Wooden Sausages",
 "data": {
 "chart": {
 "height": "100%",
 "type": "donut"
},
 "series": [
44,
55,
41,
17,
15
],
 "responsive": [
{
 "breakpoint": 480,
 "options": {
 "chart": {
 "width": 200
},
 "legend": {
 "position": "bottom"
}
}
}
]
},
 "_id": "5cf6307a245e2b001efd2111",
 "id": "5cf6307a245e2b001efd2111"
}
`

console.time('eval')
let e = {}
eval('e =' + json)
console.timeEnd('eval')


console.time('JSON.parse')
let p = {}
p = JSON.parse(json)
console.timeEnd('JSON.parse')


console.time('Function')
let f = {}
f = new Function('return' + json)
console.timeEnd('Function')


eval: 0.209 ms
JSON.parse: 0.046 ms
Function: 0.085 ms

Find more questions by tags JSONJavaScript