https://github.com/gogf/gf/v2/blob/master/container/gqueue/gqueue_z_bench_test.go

    Benchmark testing of gqueue and the standard library channel, where each benchmark test has a b.N value of 20000000 to ensure consistent dynamic queue access and prevent deadlock:

    1. goos: linux
    2. goarch: amd64
    3. pkg: github.com/gogf/gf/v2/container/gqueue
    4. Benchmark_Gqueue_StaticPushAndPop-4 20000000 84.2 ns/op
    5. Benchmark_Gqueue_DynamicPush-4 20000000 164 ns/op
    6. Benchmark_Gqueue_DynamicPop-4 20000000 121 ns/op
    7. Benchmark_Channel_PushAndPop-4 20000000 70.0 ns/op
    8. PASS

    It can be seen that the read and write performance of the standard library channel is very high, but due to the need to initialize memory during creation, the efficiency is very, very low when creating a channel (initialization involves memory allocation), and it is limited by the queue size, meaning that the written data cannot exceed the specified queue size. gqueue is more flexible to use compared to channel, offering higher creation efficiency (dynamically allocated memory) and not being restricted by queue size (though size can be limited).