Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Mike Schinkel
On Saturday, March 9, 2024 at 12:16:51 AM UTC-5 Robert Engels wrote: My guess is that most applications are decoding 25gb json files with any regularity. Even transferring 25 GB over the fastest of networks takes 20 secs? So that reduces the cost to less than 10%??? How about rather than guess

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Robert Engels
My guess is that most applications are decoding 25gb json files with any regularity. Even transferring 25 GB over the fastest of networks takes 20 secs? So that reduces the cost to less than 10%???The test isn’t doing anything with the decoded json - maybe Go is 1000% faster in that. This is either

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Mike Schinkel
Hi Robert, Thanks for the reply. I decided to run a quick benchmark so I compared Go 1.22's *json.UnMarshal(any)* using an *any* type with PHP 8.3.2's *json_decode()* and found that PHP's option is 85% faster for a ~25Mb JSON file. Optimizing it with a *struct* I was able to get Go down to bei

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Robert Engels
Related, 30k of anything is largely meaningless for modern hardware in terms of cpu processing - where billions of operations a second is the norm. On Mar 8, 2024, at 8:55 PM, Robert Engels wrote:The point I was trying to make - maybe unclear - is that it is doubtful any raw performance differenc

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Robert Engels
The point I was trying to make - maybe unclear - is that it is doubtful any raw performance differences between PHP and Go in terms of json encoding/decoding would be noticeable- unless it was a hft/hpc system which would be doubtful given that the original system was PHP. So if there is detectable

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Mike Schinkel
Hi Robert, I am now confused. While your original reply to this thread made perfect sense to me, your follow up for the purposes of clarification had the opposite effect, at least for me. I am not clear the point you are trying to make. You mention the difference between compiled and interpre

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Robert Engels
Just to be clear for others - from a raw cpu performance perspective when looking at a typical application in whole - there is very little performance difference between compiled and even GC platforms- interpreted can lag behind a bit - but in almost all cases over the web it is IO performance/desi

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Mike Schinkel
Hi Pragya, While Robert Engles is probably correct in identifying your bottleneck, if it does turn out to be slow JSON parsing here are a few things you can look at . 1. You mention you have to use a map because of response keys not be

Re: [go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread Robert Engels
It is highly unlikely that the Go marshaling is the cause. I’m guessing you are probably not using a buffered output stream. PHP is written in C but depending on what you are doing it is either a script or calling out to another process (afaik) On Mar 8, 2024, at 2:35 PM, pragya singh wrote:Hi,"I

[go-nuts] govulncheck

2024-03-08 Thread Colton Freeman
good day all, i am not a developer and have just recently stumbled upon the `govulncheck` tool from golang. i am curious how accurate this tool is and if it should be used in a scan report for vulnerabilities? do we need to run this on the main.go and reference the go.mod file in the project? a

[go-nuts] How To Reduce Json Marshalling Time

2024-03-08 Thread pragya singh
Hi, "I am facing an issue in my Go code. I converted my read API from PHP to Go, but the response time of Go API is higher than PHP. We are returning the response in JSON format, and the response contains around 30k keys, which is taking too much time in JSON marshaling. We are adding all the r

Re: [go-nuts] rsc.io/script: How to contribute?

2024-03-08 Thread twp...@gmail.com
Many thanks for the response Russ. It's clear I should stick with testscript for now. Regards, Tom On Friday, March 8, 2024 at 3:04:10 AM UTC+1 Russ Cox wrote: > Hi all, > > I published rsc.io/script for people to play with, to support my testing > talk . Fo