[go-nuts] Re: discrepancy between goal heap size and NextGC

2024-01-30 Thread 'Michael Knyszek' via golang-nuts
838103616 bytes is 799 MiB (Mebibytes, the power-of-two-based prefix), which matches GC 13. (Note that the computation for the heap goal just divides by 1<<20, or 1 MiB.) The discrepancy in GC count is probably due to the fact that the GC count value reported by the GC trace is *after* the

[go-nuts] Re: array index not starting at 0

2024-01-30 Thread 'Michael Knyszek' via golang-nuts
I see that you're on Windows. The clock granularity on Windows is really coarse (15 ms) because AFAIK there are no fast fine-grained OS-level clocks available. There are fine-grained clocks, but they're heavyweight. They're too heavyweight for many situations in the runtime, but honestly,

Re: [go-nuts] Re: Is encoding/json POSIX compatible?

2024-01-30 Thread Jason Phillips
More generally, the input and output of encoding/json need not be a file at all. On Tuesday, January 30, 2024 at 10:54:57 AM UTC-5 Brian Candler wrote: > By the definition of "3.403 Text File > " > > then

[go-nuts] Re: array index not starting at 0

2024-01-30 Thread Leah Stapleton
Is it possible that some PauseNs numbers are so small that they're rounded down to 0? On Monday, January 29, 2024 at 9:45:32 AM UTC-5 Leah Stapleton wrote: > go version go1.21.5 windows/amd64 > > There have been 9 garbage collections according to NumGC and also the > PauseEnd array; However,

Re: [go-nuts] Re: Is encoding/json POSIX compatible?

2024-01-30 Thread 'Brian Candler' via golang-nuts
By the definition of "3.403 Text File " then no, because a JSON file can have arbitrarily long lines. Note also: "Although POSIX.1-2017 does not distinguish between text files and binary files (see the ISO C

[go-nuts] Re: discrepancy between goal heap size and NextGC

2024-01-30 Thread Michael Mitchell
Might it have something to do with the comment in mgc.go about how the increment of memstats.numgc differs from the increment of GC cycles for gctrace? memstats.numgc seems to get incremented earlier (after mark termination) whereas gctrace waits until the sweep is done. // cycles is the

Re: [go-nuts] Re: Is encoding/json POSIX compatible?

2024-01-30 Thread Javier Marti
So, as per the link that I sent, a json file is not a text file, right? is just a file, I want to have this clear thanks On Tue, Jan 30, 2024 at 3:50 PM 'Brian Candler' via golang-nuts < golang-nuts@googlegroups.com> wrote: > The JSON spec does not require any whitespace after the object,

[go-nuts] Re: Is encoding/json POSIX compatible?

2024-01-30 Thread 'Brian Candler' via golang-nuts
The JSON spec does not require any whitespace after the object, newline or otherwise. And POSIX does not require that files end with a newline. Maybe you are thinking of another spec, like https://jsonlines.org/ - but that's not part of JSON. On Tuesday 30 January 2024 at 14:16:35 UTC Xabi

[go-nuts] Is encoding/json POSIX compatible?

2024-01-30 Thread Xabi Martí
I'm writing a program that uses enconding/json and when writing the files I see that it doesn't add a newline character at the end of the file, according to https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap03.html#tag_03_206 it is supposed that a line is: 3.206 Line A