What do you mean by "native JS JSON"?

JSON ("JavaScript Object Notation") is a standardized format for string
representations of objects. "JSON.stringify" creates this string
representation for a given object, "JSON.parse" creates a new object from
this string representation. If you want to transfer a string, and then
create an object from it, then JSON.Parse (which is exposed as
V8::JSON::Parse in the V8 API) is the way to go.

(Depending on your use case, instead of transferring a JSON string, passing
around an ArrayBuffer with externalized data might be a better fit. Then
there would be no conversions to string and back.)


On Thu, Mar 16, 2017 at 3:39 PM, Abhishek Singh <singhabhishek....@gmail.com
> wrote:

> Hi,
>
> I'm trying to send JSON data to user supplied JS code, which is executed
> by V8. What I've realised is even if user data is JSON marshalled, I've to
> explicitly do V8::JSON::Parse on it, so that value received in JS world is
> native JS JSON. Is that really necessary? Performance penalty because of
> it, is quite high(screenshot of profile attached).
>
>
>
> <https://lh3.googleusercontent.com/-y9ml-f0jE8c/WMqjEdHXcrI/AAAAAAAADuo/CiSBic1JwaIxui5NmJvOOpOQpziuVu1ZwCLcB/s1600/Screen%2BShot%2B2017-03-16%2Bat%2B19.53.08.png>
>
> --
> --
> v8-users mailing list
> v8-users@googlegroups.com
> http://groups.google.com/group/v8-users
> ---
> You received this message because you are subscribed to the Google Groups
> "v8-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to v8-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
v8-users mailing list
v8-users@googlegroups.com
http://groups.google.com/group/v8-users
--- 
You received this message because you are subscribed to the Google Groups 
"v8-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to v8-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to