On Mon, Dec 28, 2020 at 5:22 PM Amit Saha <amitsaha...@gmail.com> wrote:
>
> Hi all, let's say I am a single large JSON object that I want to
> process in my HTTP server backend.
>
> I am trying to get my head around if there is any performance
> advantage - memory or CPU to use the json.NewDecoder()/Decode()
> mechanism versus the Unmarshal() function?

Unmarshal uses the decoder for unmarshaling. Unless you are planning
to process the JSON object piece by piece using a decoder, the two are
identical in terms of performance.

>
> Thanks,
> Amit
>
> --
> You received this message because you are subscribed to the Google Groups 
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/CANODV3%3DU2KRRkvAAEfYqRtCVtYnh2dmGreqePF8QXLo1PriSPw%40mail.gmail.com.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAMV2RqoBk_9SnEP5M8%3DnzC63qsECFyNpRU%3DU8YAMR2byXjWuqw%40mail.gmail.com.

Reply via email to