profile
viewpoint
Ben Shi benshi001 Tianjin, China. I'm interested in Go & LLVM.

issue commentgolang/go

runtime: fatal error: gopark: bad g status

Add an extra USB disk and mount is as swap? I had a similiar issue and the extra swap fixed it.

mmli519

comment created time in 4 months

issue commentgolang/go

proposal: cmd/go: add GOARM=8 for further optimization on armv7/aarch32

The reason why "GOARM=8" works well, is due to

  1. the software division routine clobbers 2 extra registers.
  2. the software division routine clobbers the input registers with the results filled.

With the "GOARM=8", the compile can fill more spilt values to the saved registers, and so the go1 benchmark improves.

So I strongly suggest adding GOARM=8, as ARM's official definition:

  1. ARMv8 == Aarch64 + Aarch32
  2. Aarch64 (ARM's term) == ARM64 (Go's term)
  3. Aarch32 = ARM32 + HWDIV + some other features

GOARM=8 does not only improve division speed, but also has potential benefits (running arm32 program on a armv8 machine)

benshi001

comment created time in 4 months

issue commentgolang/go

proposal: cmd/go: add GOARM=8 for further optimization on armv7/aarch32

unfortunantely, the go1 benchmark shows little improvement for a runtime check of a hardware dividor.

name                     old time/op    new time/op    delta
BinaryTree17-4              21.1s ± 1%     21.3s ± 1%  +1.30%  (p=0.000 n=40+40)
Fannkuch11-4                8.34s ± 0%     8.08s ± 0%  -3.14%  (p=0.000 n=40+40)
FmtFprintfEmpty-4           285ns ± 0%     284ns ± 0%  -0.24%  (p=0.000 n=40+34)
FmtFprintfString-4          578ns ± 0%     570ns ± 0%  -1.30%  (p=0.000 n=38+40)
FmtFprintfInt-4             613ns ± 0%     597ns ± 0%  -2.56%  (p=0.000 n=33+40)
FmtFprintfIntInt-4          915ns ± 0%     898ns ± 0%  -1.87%  (p=0.000 n=39+40)
FmtFprintfPrefixedInt-4    1.00µs ± 0%    0.98µs ± 0%  -1.16%  (p=0.000 n=38+37)
FmtFprintfFloat-4          1.86µs ± 0%    1.88µs ± 0%  +0.84%  (p=0.000 n=37+37)
FmtManyArgs-4              3.39µs ± 0%    3.36µs ± 0%  -0.84%  (p=0.000 n=40+40)
GobDecode-4                32.5ms ± 1%    33.3ms ± 1%  +2.45%  (p=0.000 n=39+39)
GobEncode-4                29.0ms ± 1%    29.1ms ± 1%  +0.48%  (p=0.001 n=36+40)
Gzip-4                      2.00s ± 2%     1.99s ± 2%  -0.47%  (p=0.019 n=40+39)
Gunzip-4                    239ms ± 0%     240ms ± 1%  +0.50%  (p=0.000 n=40+40)
HTTPClientServer-4          705µs ± 2%     729µs ± 4%  +3.52%  (p=0.000 n=35+36)
JSONEncode-4               75.4ms ± 1%    75.4ms ± 1%    ~     (p=0.845 n=36+39)
JSONDecode-4                307ms ± 5%     307ms ± 5%    ~     (p=0.407 n=39+36)
Mandelbrot200-4            16.5ms ± 0%    16.5ms ± 0%    ~     (p=0.206 n=37+40)
GoParse-4                  21.6ms ± 6%    21.7ms ± 6%    ~     (p=0.819 n=39+39)
RegexpMatchEasy0_32-4       475ns ± 0%     479ns ± 0%  +0.84%  (p=0.000 n=34+32)
RegexpMatchEasy0_1K-4      3.58µs ± 0%    3.58µs ± 0%    ~     (p=0.090 n=39+40)
RegexpMatchEasy1_32-4       515ns ± 1%     513ns ± 0%  -0.33%  (p=0.000 n=39+37)
RegexpMatchEasy1_1K-4      4.52µs ± 1%    4.47µs ± 0%  -1.10%  (p=0.000 n=40+40)
RegexpMatchMedium_32-4     32.6ns ± 0%    32.6ns ± 0%    ~     (p=0.265 n=40+40)
RegexpMatchMedium_1K-4      154µs ± 0%     153µs ± 0%  -0.68%  (p=0.000 n=37+40)
RegexpMatchHard_32-4       10.0µs ± 0%     9.9µs ± 0%  -1.30%  (p=0.000 n=32+40)
RegexpMatchHard_1K-4        299µs ± 0%     295µs ± 0%  -1.35%  (p=0.000 n=39+38)
Revcomp-4                  34.6ms ± 2%    34.5ms ± 2%    ~     (p=0.054 n=39+38)
Template-4                  518ms ± 4%     519ms ± 3%    ~     (p=0.702 n=40+38)
TimeParse-4                2.47µs ± 0%    2.49µs ± 0%  +0.77%  (p=0.000 n=39+40)
TimeFormat-4               5.06µs ± 0%    5.08µs ± 1%  +0.34%  (p=0.000 n=40+39)
[Geo mean]                  262µs          262µs       -0.17%

name                     old speed      new speed      delta
GobDecode-4              23.6MB/s ± 1%  23.1MB/s ± 1%  -2.39%  (p=0.000 n=39+39)
GobEncode-4              26.5MB/s ± 1%  26.4MB/s ± 1%  -0.48%  (p=0.001 n=36+40)
Gzip-4                   9.71MB/s ± 2%  9.76MB/s ± 2%  +0.48%  (p=0.022 n=40+39)
Gunzip-4                 81.1MB/s ± 0%  80.7MB/s ± 1%  -0.50%  (p=0.000 n=40+40)
JSONEncode-4             25.7MB/s ± 1%  25.7MB/s ± 1%    ~     (p=0.886 n=36+39)
JSONDecode-4             6.33MB/s ± 5%  6.31MB/s ± 5%    ~     (p=0.313 n=39+37)
GoParse-4                2.68MB/s ± 7%  2.67MB/s ± 6%    ~     (p=0.802 n=39+39)
RegexpMatchEasy0_32-4    67.4MB/s ± 0%  66.8MB/s ± 0%  -0.85%  (p=0.000 n=40+34)
RegexpMatchEasy0_1K-4     286MB/s ± 0%   286MB/s ± 0%    ~     (p=0.120 n=39+40)
RegexpMatchEasy1_32-4    62.2MB/s ± 1%  62.4MB/s ± 0%  +0.36%  (p=0.000 n=40+37)
RegexpMatchEasy1_1K-4     226MB/s ± 1%   229MB/s ± 0%  +1.12%  (p=0.000 n=40+40)
RegexpMatchMedium_32-4   30.6MB/s ± 0%  30.6MB/s ± 0%    ~     (p=0.126 n=40+40)
RegexpMatchMedium_1K-4   6.65MB/s ± 0%  6.70MB/s ± 0%  +0.70%  (p=0.000 n=38+32)
RegexpMatchHard_32-4     3.19MB/s ± 0%  3.23MB/s ± 0%  +1.32%  (p=0.000 n=32+37)
RegexpMatchHard_1K-4     3.42MB/s ± 0%  3.47MB/s ± 0%  +1.46%  (p=0.000 n=40+38)
Revcomp-4                73.4MB/s ± 2%  73.6MB/s ± 2%    ~     (p=0.061 n=39+38)
Template-4               3.75MB/s ± 5%  3.74MB/s ± 3%    ~     (p=0.634 n=40+38)
[Geo mean]               21.2MB/s       21.2MB/s       +0.04%
benshi001

comment created time in 4 months

issue closedgolang/go

wasm: no standard output on Windows

<!-- Please answer these questions before submitting your issue. Thanks! -->

What version of Go are you using (go version)?

<pre> $ go version go version go1.12.6 windows/amd64 </pre>

Does this issue reproduce with the latest release?

NA

What operating system and processor architecture are you using (go env)?

<details><summary><code>go env</code> Output</summary><br><pre> $ go env set GOARCH=amd64 set GOBIN= set GOCACHE=C:\Users\jdemartel\AppData\Local\go-build set GOEXE=.exe set GOFLAGS= set GOHOSTARCH=amd64 set GOHOSTOS=windows set GOOS=windows set GOPATH=C:\Users\jdemartel\go set GOPROXY= set GORACE= set GOROOT=c:\go set GOTMPDIR= set GOTOOLDIR=c:\go\pkg\tool\windows_amd64 set GCCGO=gccgo set CC=gcc set CXX=g++ set CGO_ENABLED=1 set GOMOD= set CGO_CFLAGS=-g -O2 set CGO_CPPFLAGS= set CGO_CXXFLAGS=-g -O2 set CGO_FFLAGS=-g -O2 set CGO_LDFLAGS=-g -O2 set PKG_CONFIG=pkg-config set GOGCCFLAGS=-m64 -mthreads -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=C:\Users\JDEMAR~1\AppData\Local\Temp\go-build750286854=/tmp/go-build -gno-record-gcc-switches </pre></details>

What did you do?

  • Write a hello world go program <details><summary> Source code </summary><br />
package main

import (
	"fmt"
	"os"
)

func main() {
	fmt.Println("standard output")
	os.Exit(0)
}

</details>

  • Compile to webassembly usingGOOS=js GOARCH=wasm go build -o main.wasm main.go
  • Run the compiled code using node and the supplied wasm_exec.js: node wasm_exec.js main.wasm
    • On linux, this works fine
    • On windows, no output appears in terminal, whether it's git bash, command prompt or powershell

What did you expect to see?

As the node versions (v12.4.0) and input files (wasm_exec.js and main.wasm) are identical, I would expect it to work on windows.

What did you see instead?

No terminal output on windows. The command completes with no output in terminal, whether it's command prompt, git bash or powershell.

This is probably a mistake on my part rather than a bug - I guess I'm missing something but can't seem to find any related information.

Thank you for your help !

EDIT: added go source code

closed time in 5 months

jb2martel

issue commentgolang/go

wasm: no standard output on Windows

Closed. Since,

  1. it is not reproducible
  2. it should not be a go issue (go wasm use console.log for fmt.Println)
jb2martel

comment created time in 5 months

issue commentgolang/go

wasm: no standard output on Windows

Please try go1.13, I can see "hello" printed with

go-1.13 for windows/amd64 node 10.16 windows server 2008 R2

package main
import "fmt"
func main() {
	fmt.Println("hello")
}
jb2martel

comment created time in 6 months

more