为什么并发不能加快我的斐波那契功能?

Here is the following concurrency example from A Tour of Go

package main

import (
    "fmt"
)

func fibonacci(n int, c chan int) {
    x, y := 0, 1
    for i := 0; i < n; i++ {
        c <- x
        x, y = y, x+y
    }
    close(c)
}

func main() {
    c := make(chan int, 10)
    go fibonacci(cap(c), c)
    for i := range c {
        fmt.Println(i)
    }
}

I modified it to not use goroutines:

package main

import (
    "fmt"
)



func fibonacci(n int) int{


    if(n==0||n==1){
        return 1
    }
    x:= 1
    y:= 1
    for i := 0; i < n; i++ {
        tmp := x
        x = y
        y = tmp + y
        fmt.Println(x)
    }
    return x
}


func main(){


    fibonacci2(100)

}

However, the time it takes are both nearly instant at n = 100000. Does anyone have an example where goroutines does speed up calculations? I am wondering if perhaps there are some compiler settings that is limiting the number of cores my program can use. Why doesn't the goroutines speed up the calculations?

These 2 versions take almost exactly the same time because most of the work is in the Fibonacci function, so it doesn't matter whether it runs on the main goroutine, or a separate goroutine. When n is large, the concurrent version can be slower, because of the communication overhead over channels.

enter image description here

You can see from the above diagram, the only work running on the main thread are 'Println' calls, which take very little time to run. But if the processing of the number on the main thread takes more time, using a goroutine to generate fibonacci number may be faster.