Hey,

I'm running windows cli exe on linux via wine using os.Exec command.. this 
takes 28s to complete. 
If I run the same command via linux cli it takes 2s to complete, if I run 
the same command via php's exec it also takes about 2 seconds to complete.

== linux cli ==

time WINEDEBUG=err-all,fixme-all WINEARCH=win32 /opt/wine-staging/bin/wine 
cmd.exe /c help
....
real    0m1,366s
user    0m0,002s
sys    0m0,225s

== php ==
cat t.php 
<?php
$out=array();

exec('WINEDEBUG=err-all,fixme-all WINEARCH=win32 /opt/wine-staging/bin/wine 
cmd.exe /c help', $out);

var_dump($out);

.....

real    0m1,427s
user    0m0,035s
sys    0m0,216s


==go exec==

func main() {
    now := time.Now()
    ctx, cancel := context.WithTimeout(context.Background(), 
120*time.Second)
    defer cancel()
    cmd := exec.CommandContext(ctx, "/opt/wine-staging/bin/wine", "cmd", 
"/c", "help")
    cmd.Env = []string{"WINEDEBUG=err-all,fixme-all", "WINEARCH=win32"}
    output, err := cmd.CombinedOutput()
    if err != nil {
        fmt.Println(err)
    }
    fmt.Println(string(output))
    fmt.Println(time.Now().Sub(now))
}

time bin/osexec

real    0m39,915s
user    0m17,062s
sys    0m0,195s


* I have tried to set stdin and std out directly to the one from os (no 
difference)
* I have replaced cmd.CombinedOutput with cmd.Run() (no difference)

go version
go version go1.13.3 linux/amd64
I'm totally clueless on what's going on.

BR,
Miha



-- 
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/9d6620a7-4c3a-4f3a-86a0-6222b898aa6c%40googlegroups.com.

Reply via email to