Re: [go-nuts] libgo is more fast that grouting.

2020-03-22 Thread 'Benjamin' via golang-nuts
I just read an article about Oracle sued Google for Java. Surely go programming 
language will be abandoned soon.

Google cannot make any popular production except search engine. Google only 
make prototype and toy production. 
I think that’s bc they think they are scientists or researchers, they do not  
think they engineers.

Android is widely used, But android is bought from other companies.

Only engineers  can produce well designed production.  Scientists or. 
researchers worked like students.



> On Mar 22, 2020, at 16:21, Benjamin  wrote:
> 
> WOW,only children from poor families do programming work.
> 
> 
>> On Mar 21, 2020, at 17:41, Dan Kortschak > <mailto:d...@kortschak.io>> wrote:
>> 
>> Please stop.
>> 
>> 
>> On Sat, 2020-03-21 at 17:20 +0800, 'Benjamin' via golang-nuts wrote:
>>> Tesla is commodity, but a programming language is not.
>>> 
>>> ]
>>> 
>>> 
>>>> On Mar 20, 2020, at 14:55, Chris Burkert >>> <mailto:burkert.ch...@gmail.com>>
>>>> wrote:
>>>> 
>>>> Do people ask for a Tesla with a combustion engine? No because they
>>>> value what Tesla is doing and why they are doing it. And neither
>>>> Tesla nor Kubernetes or Docker are research projects. So please
>>>> don’t whine about how things are. Instead (as Ian said) participate
>>>> in a positive manner and contribute to make things better. The code
>>>> of conduct is a good starting point: https://golang.org/conduct 
>>>> <https://golang.org/conduct>
>>>> 
>>>> 'Benjamin' via golang-nuts >>> <mailto:golang-nuts@googlegroups.com>> schrieb
>>>> am Fr. 20. März 2020 um 06:52:
>>>>> I think the team of go programming language should invite other
>>>>> people that out of google join some part of the project. And you
>>>>> all can have more free time. 
>>>>> 
>>>>> Sometimes Lazy is good habit. It’s 10+ years, go should not be a
>>>>> research project now. How Many 10 years do you have?  Like what
>>>>> is the binary package file of go? c/c++ have dll/so file, java
>>>>> has jar file, even php has a phar file.
>>>>> 
>>>>> Guess what this project will happen when you all leave google?
>>>>> Only projects like PHP and Python and Java are real open source
>>>>> community driven project. They are all not belong to any company.
>>>>> 
>>>>> 
>>>>> 
>>>>>> On Mar 19, 2020, at 00:00, Ian Lance Taylor >>>>> <mailto:i...@golang.org>>
>>>>> wrote:
>>>>>> 
>>>>>> On Tue, Mar 17, 2020 at 11:12 PM 'Benjamin' via golang-nuts
>>>>>> mailto:golang-nuts@googlegroups.com>> 
>>>>>> wrote:
>>>>>>> 
>>>>>>> Benchmark shows that lingo is faster than goroutine.
>>>>>>> 
>>>>>>> Many china internet companies use similar c++ libraries to
>>>>> support trillions of concurrency.
>>>>>>> Like Tencent use a smiler project libco:
>>>>>>> https://github.com/Tencent/libco <https://github.com/Tencent/libco>
>>>>>>> 
>>>>>>> I think the go team should learn some idea from these
>>>>> projects.
>>>>>>> NOT invent new thing is not necessary, its waste of time. Not
>>>>> all developers have 10+ years time to wait a new programming
>>>>> language become maturity .
>>>>>> 
>>>>>> Go is an open source project.  I encourage you, and anyone who
>>>>> is
>>>>>> interested, to investigate these libraries to understand why
>>>>> they are
>>>>>> faster, and what Go can do to speed up.  The more people work
>>>>> on Go,
>>>>>> the less time everyone will have to wait for better
>>>>> performance.
>>>>>> Thanks.
>>>>>> 
>>>>>> Ian
>>>>> 
>>>>> -- 
>>>>> 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 
>>>>> <mailto:golang-nuts+unsubscr...@googlegroups.com>.
>>>>> To view this discussion on the web visit 
>>>>> https://groups.google.com/d/msgid/golang-nuts/70EE3DB8-EE16-4A70-B72E-D01E48EF4C82%40icloud.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/golang-nuts/70EE3DB8-EE16-4A70-B72E-D01E48EF4C82%40icloud.com>
>>>>> .
>>> 
>>> -- 
>>> 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 
>>> <mailto:golang-nuts+unsubscr...@googlegroups.com>.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/golang-nuts/F26D8325-98DB-4001-B4BC-6AC2D9C3609F%40icloud.com
>>>  
>>> <https://groups.google.com/d/msgid/golang-nuts/F26D8325-98DB-4001-B4BC-6AC2D9C3609F%40icloud.com>
>>> .
>> 
>> 
> 

-- 
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/FEE9B207-02F5-485D-AC66-3184895F8F87%40icloud.com.


Re: [go-nuts] libgo is more fast that grouting.

2020-03-22 Thread 'Benjamin' via golang-nuts
WOW,only children from poor families do programming work.


> On Mar 21, 2020, at 17:41, Dan Kortschak  wrote:
> 
> Please stop.
> 
> 
> On Sat, 2020-03-21 at 17:20 +0800, 'Benjamin' via golang-nuts wrote:
>> Tesla is commodity, but a programming language is not.
>> 
>> ]
>> 
>> 
>>> On Mar 20, 2020, at 14:55, Chris Burkert 
>>> wrote:
>>> 
>>> Do people ask for a Tesla with a combustion engine? No because they
>>> value what Tesla is doing and why they are doing it. And neither
>>> Tesla nor Kubernetes or Docker are research projects. So please
>>> don’t whine about how things are. Instead (as Ian said) participate
>>> in a positive manner and contribute to make things better. The code
>>> of conduct is a good starting point: https://golang.org/conduct
>>> 
>>> 'Benjamin' via golang-nuts  schrieb
>>> am Fr. 20. März 2020 um 06:52:
>>>> I think the team of go programming language should invite other
>>>> people that out of google join some part of the project. And you
>>>> all can have more free time. 
>>>> 
>>>> Sometimes Lazy is good habit. It’s 10+ years, go should not be a
>>>> research project now. How Many 10 years do you have?  Like what
>>>> is the binary package file of go? c/c++ have dll/so file, java
>>>> has jar file, even php has a phar file.
>>>> 
>>>> Guess what this project will happen when you all leave google?
>>>> Only projects like PHP and Python and Java are real open source
>>>> community driven project. They are all not belong to any company.
>>>> 
>>>> 
>>>> 
>>>>> On Mar 19, 2020, at 00:00, Ian Lance Taylor 
>>>> wrote:
>>>>> 
>>>>> On Tue, Mar 17, 2020 at 11:12 PM 'Benjamin' via golang-nuts
>>>>>  wrote:
>>>>>> 
>>>>>> Benchmark shows that lingo is faster than goroutine.
>>>>>> 
>>>>>> Many china internet companies use similar c++ libraries to
>>>> support trillions of concurrency.
>>>>>> Like Tencent use a smiler project libco:
>>>>>> https://github.com/Tencent/libco
>>>>>> 
>>>>>> I think the go team should learn some idea from these
>>>> projects.
>>>>>> NOT invent new thing is not necessary, its waste of time. Not
>>>> all developers have 10+ years time to wait a new programming
>>>> language become maturity .
>>>>> 
>>>>> Go is an open source project.  I encourage you, and anyone who
>>>> is
>>>>> interested, to investigate these libraries to understand why
>>>> they are
>>>>> faster, and what Go can do to speed up.  The more people work
>>>> on Go,
>>>>> the less time everyone will have to wait for better
>>>> performance.
>>>>> Thanks.
>>>>> 
>>>>> Ian
>>>> 
>>>> -- 
>>>> 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/70EE3DB8-EE16-4A70-B72E-D01E48EF4C82%40icloud.com
>>>> .
>> 
>> -- 
>> 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/F26D8325-98DB-4001-B4BC-6AC2D9C3609F%40icloud.com
>> .
> 
> 

-- 
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/F8B82C90-5C08-4160-9D16-5456D718DFBE%40icloud.com.


Re: [go-nuts] libgo is more fast that grouting.

2020-03-21 Thread 'Benjamin' via golang-nuts
Tesla is commodity, but a programming language is not.

]


> On Mar 20, 2020, at 14:55, Chris Burkert  wrote:
> 
> Do people ask for a Tesla with a combustion engine? No because they value 
> what Tesla is doing and why they are doing it. And neither Tesla nor 
> Kubernetes or Docker are research projects. So please don’t whine about how 
> things are. Instead (as Ian said) participate in a positive manner and 
> contribute to make things better. The code of conduct is a good starting 
> point: https://golang.org/conduct <https://golang.org/conduct>
> 
> 'Benjamin' via golang-nuts  <mailto:golang-nuts@googlegroups.com>> schrieb am Fr. 20. März 2020 um 06:52:
> I think the team of go programming language should invite other people that 
> out of google join some part of the project. And you all can have more free 
> time. 
> 
> Sometimes Lazy is good habit. It’s 10+ years, go should not be a research 
> project now. How Many 10 years do you have?  Like what is the binary package 
> file of go? c/c++ have dll/so file, java has jar file, even php has a phar 
> file.
> 
> Guess what this project will happen when you all leave google? Only projects 
> like PHP and Python and Java are real open source community driven project. 
> They are all not belong to any company.
> 
> 
> 
> > On Mar 19, 2020, at 00:00, Ian Lance Taylor  > <mailto:i...@golang.org>> wrote:
> > 
> > On Tue, Mar 17, 2020 at 11:12 PM 'Benjamin' via golang-nuts
> > mailto:golang-nuts@googlegroups.com>> wrote:
> >> 
> >> Benchmark shows that lingo is faster than goroutine.
> >> 
> >> Many china internet companies use similar c++ libraries to support 
> >> trillions of concurrency.
> >> Like Tencent use a smiler project libco:
> >> https://github.com/Tencent/libco <https://github.com/Tencent/libco>
> >> 
> >> I think the go team should learn some idea from these projects.
> >> NOT invent new thing is not necessary, its waste of time. Not all 
> >> developers have 10+ years time to wait a new programming language become 
> >> maturity .
> > 
> > Go is an open source project.  I encourage you, and anyone who is
> > interested, to investigate these libraries to understand why they are
> > faster, and what Go can do to speed up.  The more people work on Go,
> > the less time everyone will have to wait for better performance.
> > Thanks.
> > 
> > Ian
> 
> -- 
> 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 
> <mailto:golang-nuts%2bunsubscr...@googlegroups.com>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/golang-nuts/70EE3DB8-EE16-4A70-B72E-D01E48EF4C82%40icloud.com
>  
> <https://groups.google.com/d/msgid/golang-nuts/70EE3DB8-EE16-4A70-B72E-D01E48EF4C82%40icloud.com>.

-- 
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/F26D8325-98DB-4001-B4BC-6AC2D9C3609F%40icloud.com.


Re: [go-nuts] libgo is more fast that grouting.

2020-03-19 Thread 'Benjamin' via golang-nuts
I think the team of go programming language should invite other people that out 
of google join some part of the project. And you all can have more free time. 

Sometimes Lazy is good habit. It’s 10+ years, go should not be a research 
project now. How Many 10 years do you have?  Like what is the binary package 
file of go? c/c++ have dll/so file, java has jar file, even php has a phar file.

Guess what this project will happen when you all leave google? Only projects 
like PHP and Python and Java are real open source community driven project. 
They are all not belong to any company.



> On Mar 19, 2020, at 00:00, Ian Lance Taylor  wrote:
> 
> On Tue, Mar 17, 2020 at 11:12 PM 'Benjamin' via golang-nuts
>  wrote:
>> 
>> Benchmark shows that lingo is faster than goroutine.
>> 
>> Many china internet companies use similar c++ libraries to support trillions 
>> of concurrency.
>> Like Tencent use a smiler project libco:
>> https://github.com/Tencent/libco
>> 
>> I think the go team should learn some idea from these projects.
>> NOT invent new thing is not necessary, its waste of time. Not all developers 
>> have 10+ years time to wait a new programming language become maturity .
> 
> Go is an open source project.  I encourage you, and anyone who is
> interested, to investigate these libraries to understand why they are
> faster, and what Go can do to speed up.  The more people work on Go,
> the less time everyone will have to wait for better performance.
> Thanks.
> 
> Ian

-- 
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/70EE3DB8-EE16-4A70-B72E-D01E48EF4C82%40icloud.com.


Re: [go-nuts] libgo is more fast that grouting.

2020-03-18 Thread 'Benjamin' via golang-nuts
Benchmark shows that lingo is faster than goroutine.

Many china internet companies use similar c++ libraries to support trillions of 
concurrency. 
Like Tencent use a smiler project libco: 
https://github.com/Tencent/libco <https://github.com/Tencent/libco>

I think the go team should learn some idea from these projects. 
NOT invent new thing is not necessary, its waste of time. Not all developers 
have 10+ years time to wait a new programming language become maturity .


> On Mar 17, 2020, at 12:23, wagner riffel  wrote:
> 
> On Mon, 16 Mar 2020 20:13:10 +0800
> "'Benjamin' via golang-nuts"  wrote:
> 
>> How do you all think about it?
>> 
> IMO there's no such thing as "Go-style concurrency" if you don't have
> `select`, which doesn't looks like this library provides (as many
> others).
> 
> —wagner

-- 
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/07D57AA5-4EEC-44A7-9C38-B689D4F57C54%40icloud.com.


[go-nuts] libgo is more fast that grouting.

2020-03-16 Thread 'Benjamin' via golang-nuts
I find a project that is very interesting, https://github.com/yyzybb537/libgo 


How do you all think about it?

-- 
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/92B08B84-B9F9-4EB3-9065-DEABFCDC4210%40icloud.com.


Re: [go-nuts] How to break-out of martini middleware

2020-03-14 Thread 'Benjamin' via golang-nuts
I don’t need to read the stackoverflow. And I don’t know martini.
Middlewares and Handler are all can break the pipeline of http request.
If martini is not designed like this, it is not well designed. Maybe the 
authors of martini do not have real production software expriences.
Big companies like google likes employing famous university graduated students.
I find even some famous researchers still like students. Event in the go team.
They have graduated from famous university for many years, but still think and 
do like students. 
Go programming language should be maintained  by engineers not scientists or 
researchers.


> On Mar 15, 2020, at 06:18, a...@oresoftware.com wrote:
> 
> I am looking for answer to this SO overflow question:
> 
> https://stackoverflow.com/questions/60679922/how-to-break-out-of-martini-middleware
> 
> In essence, I am wondering how to send the response, and *not* invoke any of 
> the subsequent middleware that is declared as part of the chain for that 
> matching request.
> There is a boolean flag on http.Response called http.Response.Close.
> 
> It's possible that martini reads from http.Response.Close to see if it should 
> invoke the remaining middleware or not, but if so that seems like an 
> imperfect practice/methodology.
> 
> -alex
> 
> -- 
> 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/b0dbef78-8d0a-49c7-8feb-b3f96ef377ea%40googlegroups.com
>  
> .

-- 
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/A3BB016C-BAC3-4B95-AB4E-56B4A2D50D58%40icloud.com.


Re: [go-nuts] Where is the version number for a golang module declared?

2020-03-12 Thread 'Benjamin' via golang-nuts
Go programming language has no version mechanism.
Like java jar files that contains class files.

If you want to use special version, the version can be included in the import 
path


> On Mar 11, 2020, at 13:32, Tamás Gulácsi  wrote:
> 
> AFAIK tags are for concrete version (vMajor.Minor.Patch), branches and a 
> subdirectory for maintaining different major versions concurrently.
> 
> -- 
> 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/ac8b47d5-3b5f-421d-a577-f7861281af84%40googlegroups.com.

-- 
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/5BE671B2-3154-49F4-85DC-83FBFC9CD359%40icloud.com.


Re: [go-nuts] Consume RESTful API Endpoints within a golang application with webtoken

2020-03-11 Thread 'Benjamin' via golang-nuts
Easy, Store the expired time in the token, and hash them.
When the expired time almost reach, use the old token to get a new token.


> On Mar 12, 2020, at 09:25, Renato Marcandier  
> wrote:
> 
> Hello guys,
> do you have any HelloWorld project in GO using RESTful to issue HTTP requests 
> from within a Golang application to remote RESTful/API with web token that 
> expires every 60 minutes and then consume any data that is returned?
> I am trying to get a simple HelloWorld. First, I need to do a POST to grab 
> the new token and after using this token to do a GET and see the response 
> with "Hello World!" using the following parameters:
> -
> POST:
> 
> Using:
> grant_type: password
> client_id: x
> client_secret: x
> username: x
> password: x
> 
> URL: 
> https://cloudsso.cisco.com/as/token.oauth2?grant_type=password_id=xx_secret==xxx=xx
>  
> 
> 
> Response:
> {
> "access_token": "tMqvXkR4wTvFwKUNUvMrNUXdzkjD",
> }
> 
> -
> GET:
> 
> Using: Bearer Token
> URL: https://api.cisco.com/hello 
> 
> Response:
> {"helloResponse":{"response":"Hello World!"}}
> 
> 
> Regards
> RG
> 
> -- 
> 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/CAGbJOOiT8fm7z6t5pNiFSmkXZy2KXs8Xdw-Cq0BkUD1CbUNExA%40mail.gmail.com
>  
> .

-- 
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/4C76B950-358E-4E9D-ADE8-B681B7F2EC44%40icloud.com.


Re: [go-nuts] SFTPGo: a Golang performance story and some questions

2020-03-11 Thread 'Benjamin' via golang-nuts
Why not merge https://go-review.googlesource.com/c/go/+/51670 
<https://go-review.googlesource.com/c/go/+/51670> since 2017?
I tell you the truth: Workers of commercial  companies dislike the community 
pull request, this will wast their free time or vacation time. They only worked 
for capitalists.



> On Mar 11, 2020, at 20:58, 'Benjamin' via golang-nuts 
>  wrote:
> 
> I think that’s why go should be driven by the community but not by Bell labs 
> nor Google labs. 
> Works in Bell Labs or Google Labs may leave the job, and may not know 
> everything. 
> But the community have enough Human Resources and various of knowledges.
> 
> Some scientists and reaserchers  worked for commercial company for whole of 
> their life, but never do a things owned by themselves. Like Anders Hejlsberg, 
> the architect of Delphi and C#.  What a pity.
> 
> I think go programming language should also belongs to the community but not 
> Google. One day Bell Lab or Google are closed, the community still exists.
> 
> 
>> On Mar 11, 2020, at 20:43, Nicola Murino > <mailto:nicola.mur...@gmail.com>> wrote:
>> 
>> Hi all,
>> 
>> I want to share the performances analysis I recently did for SFTPGo, the 
>> fully featured and highly configurable SFTP server written in Go 
>> (https://github.com/drakkan/sftpgo <https://github.com/drakkan/sftpgo>).
>> 
>> When I decided to write an SFTP server I evaluated the available libraries 
>> and I did some quick performance tests too.
>> 
>> Golang's SSH stack and pkg/sftp were able to easily saturate a Gigabit 
>> connection and this seemed enough. I noticed that OpenSSH was faster, but I 
>> didn't investigate further.
>> 
>> So I chose Golang for SFTPGo.
>> 
>> The project is growing fast and one of the users also noticed that SFTPGo 
>> has lower performance than OpenSSH. He opened an issue providing some stats 
>> when using a 40Gb Ethernet card.
>> 
>> I did some more profiling and discovered that the main bottlenecks are, 
>> unsurprisingly, the cipher used and the message authentication. So we can 
>> have a huge performance boost using a fast cipher with implicit messages 
>> authentication, for example aes128-...@openssh.com 
>> <mailto:aes128-...@openssh.com>, however this cipher is not widely supported.
>> 
>> The most used cipher, and the one used in the user's tests is AES-CTR, and 
>> the Golang implementations seems quite slow.
>> 
>> He noticed that an unmerged patch is available for Golang, greatly improving 
>> AES-CTR performance:
>> 
>> https://go-review.googlesource.com/c/go/+/51670 
>> <https://go-review.googlesource.com/c/go/+/51670>
>> 
>> I applied this patch and, while performance improved, the AES-CTR SFTP 
>> transfers were still slower than the AES-GCM ones. The bottleneck is now the 
>> MAC computation.
>> 
>> The tested hardware supports Intel SHA extensions but Golang's SHA256 
>> implementation only uses the AVX2 extension.
>> 
>> Again, I was lucky: I can simply use minio/sha256-simd as a drop-in 
>> replacement for Golang's SHA256 implementation:
>> 
>> https://github.com/drakkan/crypto/commit/17ef3d252b1c9d6124fa17889033e11eaa5c9ddb
>>  
>> <https://github.com/drakkan/crypto/commit/17ef3d252b1c9d6124fa17889033e11eaa5c9ddb>
>> 
>> The performance improved again, but OpenSSH was still faster.
>> 
>> To my great surprise I noticed that my very simple SCP implementation 
>> (https://github.com/drakkan/sftpgo/blob/master/sftpd/scp.go 
>> <https://github.com/drakkan/sftpgo/blob/master/sftpd/scp.go>) was now as 
>> fast as OpenSSH!
>> 
>> So this time I have to look at pkg/sftp: I found some extraneous 
>> copies/allocations in critical paths and I sent some pull requests that are 
>> now merged in the master branch. Still, SFTP transfers were slower than 
>> OpenSSH ones.
>> 
>> Compared to my SCP implementation the main difference is that pkg/sftp 
>> allocates a new slice for each SFTP packet, while my SCP implementation 
>> allocates a slice once and then reuses this slice. 
>> 
>> Basically for each SFTP packet pkg/sftp does something like this:
>> 
>> data := make([]byte, size)
>> 
>> So I wrote a proof of concept allocator that tries to avoid all these extra 
>> allocations reusing the previously allocated slices:
>> 
>> https://github.com/drakkan/sftp/blob/master/allocator.go 
>> <https://github.com/drakkan/sftp/blob/master/allocator.go>
>> 
>> And bingo! Now SFTPGo performance is very close to

Re: [go-nuts] SFTPGo: a Golang performance story and some questions

2020-03-11 Thread 'Benjamin' via golang-nuts
I think that’s why go should be driven by the community but not by Bell labs 
nor Google labs. 
Works in Bell Labs or Google Labs may leave the job, and may not know 
everything. 
But the community have enough Human Resources and various of knowledges.

Some scientists and reaserchers  worked for commercial company for whole of 
their life, but never do a things owned by themselves. Like Anders Hejlsberg, 
the architect of Delphi and C#.  What a pity.

I think go programming language should also belongs to the community but not 
Google. One day Bell Lab or Google are closed, the community still exists.


> On Mar 11, 2020, at 20:43, Nicola Murino  wrote:
> 
> Hi all,
> 
> I want to share the performances analysis I recently did for SFTPGo, the 
> fully featured and highly configurable SFTP server written in Go 
> (https://github.com/drakkan/sftpgo).
> 
> When I decided to write an SFTP server I evaluated the available libraries 
> and I did some quick performance tests too.
> 
> Golang's SSH stack and pkg/sftp were able to easily saturate a Gigabit 
> connection and this seemed enough. I noticed that OpenSSH was faster, but I 
> didn't investigate further.
> 
> So I chose Golang for SFTPGo.
> 
> The project is growing fast and one of the users also noticed that SFTPGo has 
> lower performance than OpenSSH. He opened an issue providing some stats when 
> using a 40Gb Ethernet card.
> 
> I did some more profiling and discovered that the main bottlenecks are, 
> unsurprisingly, the cipher used and the message authentication. So we can 
> have a huge performance boost using a fast cipher with implicit messages 
> authentication, for example aes128-...@openssh.com, however this cipher is 
> not widely supported.
> 
> The most used cipher, and the one used in the user's tests is AES-CTR, and 
> the Golang implementations seems quite slow.
> 
> He noticed that an unmerged patch is available for Golang, greatly improving 
> AES-CTR performance:
> 
> https://go-review.googlesource.com/c/go/+/51670
> 
> I applied this patch and, while performance improved, the AES-CTR SFTP 
> transfers were still slower than the AES-GCM ones. The bottleneck is now the 
> MAC computation.
> 
> The tested hardware supports Intel SHA extensions but Golang's SHA256 
> implementation only uses the AVX2 extension.
> 
> Again, I was lucky: I can simply use minio/sha256-simd as a drop-in 
> replacement for Golang's SHA256 implementation:
> 
> https://github.com/drakkan/crypto/commit/17ef3d252b1c9d6124fa17889033e11eaa5c9ddb
> 
> The performance improved again, but OpenSSH was still faster.
> 
> To my great surprise I noticed that my very simple SCP implementation 
> (https://github.com/drakkan/sftpgo/blob/master/sftpd/scp.go) was now as fast 
> as OpenSSH!
> 
> So this time I have to look at pkg/sftp: I found some extraneous 
> copies/allocations in critical paths and I sent some pull requests that are 
> now merged in the master branch. Still, SFTP transfers were slower than 
> OpenSSH ones.
> 
> Compared to my SCP implementation the main difference is that pkg/sftp 
> allocates a new slice for each SFTP packet, while my SCP implementation 
> allocates a slice once and then reuses this slice. 
> 
> Basically for each SFTP packet pkg/sftp does something like this:
> 
> data := make([]byte, size)
> 
> So I wrote a proof of concept allocator that tries to avoid all these extra 
> allocations reusing the previously allocated slices:
> 
> https://github.com/drakkan/sftp/blob/master/allocator.go
> 
> And bingo! Now SFTPGo performance is very close to OpenSSH! You can find the 
> full benchmark results here:
> 
> https://github.com/drakkan/sftpgo/blob/master/docs/performance.md
> 
> Conclusion: I see several complaints about Go performance, especially 
> compared to Rust, but, at least in my use case, Go can be as fast as a C 
> project (such as OpenSSH). But some special attention is required and thus 
> this improved performance is not by default available to all the users.
> 
> Now some questions:
> 
> 1) for the pkg/sftp allocator I'm discussing with pkg/sftp maintainers to 
> find a way to get it included. Do you have smarter ideas to avoid these 
> allocations?
> 2) There is a patch available for AES-CTR in Golang (since 2017): I wonder 
> why it is not yet merged?
> 3) To improve SHA computation performance, I cannot find anything usable in 
> Golang itself. Is there any plan to have support for Intel SHA Extensions and 
> AVX512 directly in Golang anytime soon?
> 
> Thank you for this great programming language, it makes it really simple to 
> add new features to SFTPGo!
> 
> regards,
> Nicola
> 
> -- 
> 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 
>