Re: 250 times faster swift actions with the Go server...
Michele By the way for a swift runtimes images including swift4 you can use the current repo runtime for Swift here https://github.com/apache/incubator-openwhisk-runtime-swift — Carlos On Thu, Feb 22, 2018 at 5:03 PM Carlos Santana wrote: > Great progress > On Thu, Feb 22, 2018 at 10:05 AM Rodric Rabbah wrote: > >> This is great. The use of python as the proxy was a historical >> convenience. Your changes are shaping up nicely; thanks for pushing it >> forward. >> >> -r >> >> > On Feb 22, 2018, at 6:08 AM, Michele Sciabarra >> wrote: >> > >> > After spending a session of learning way more swift I ever wanted to >> know, I hacked an horrible sample of Swift code implementing the Hello >> World as a read-stdin-write-std-out loop. >> > >> > The code in all his ugliness I do not dare to post is here: >> > >> > >> https://github.com/sciabarracom/openwhisk-runtime-go/blob/pipe-loop/HelloSwift/Sources/Hello/main.swift >> > >> > However I used this example to to compare my new implementation in Go >> with the current one (as described in James Thomas blog post >> http://jamesthom.as/blog/2017/06/28/serverless-swift-with-openwhisk/) >> and this is the result: >> > >> > +--+---+--+--+--+--+--+-+--+ >> > | Label | # | Avg | Med | 90% | 95% | 99% | Min | Max | >> > +--+---+--+--+--+--+--+-+--+ >> > | Current | 1 | 1097 | 1101 | 1169 | 1191 | 1243 | 19 | 2132 | >> > | Go+Swift | 1 |4 |4 |6 |6 | 10 | 2 | 1030 | >> > | TOTAL| 2 | 551 | 66 | 1148 | 1169 | 1221 | 2 | 2132 | >> > +--+---+--+--+--+--+--+-+--+ >> > >> > To be honest I am not sure why. As far as I know, Swift support is >> implemented as a read-write loop too (or at least this is what looks like >> to a quick look to the code), however python is not famous to be a >> performing language (and I suspect the Global Interpreter Lock may play a >> role in those numbers). >> > >> > I did also a comparison of Go and Swift running under my new >> implementation. Implemented in this way , the are basically the same speed. >> > >> > However it is worth to be noted that the image for Golang only is 10MB, >> but if I have to add swift support you need a lot of libraries on it. I >> used a docker image based on ibmcom/ubuntu-swift but it is huge (1.8G!), I >> think a trimmed down version is needed. >> > >> > All the code is in my repo in the pipe-loop branch. Now I think I will >> have to take the time to clean up the code and make it robust. >> > >> > >> > -- >> > Michele Sciabarra >> > openwh...@sciabarra.com >> >
Re: 250 times faster swift actions with the Go server...
Great progress On Thu, Feb 22, 2018 at 10:05 AM Rodric Rabbah wrote: > This is great. The use of python as the proxy was a historical > convenience. Your changes are shaping up nicely; thanks for pushing it > forward. > > -r > > > On Feb 22, 2018, at 6:08 AM, Michele Sciabarra > wrote: > > > > After spending a session of learning way more swift I ever wanted to > know, I hacked an horrible sample of Swift code implementing the Hello > World as a read-stdin-write-std-out loop. > > > > The code in all his ugliness I do not dare to post is here: > > > > > https://github.com/sciabarracom/openwhisk-runtime-go/blob/pipe-loop/HelloSwift/Sources/Hello/main.swift > > > > However I used this example to to compare my new implementation in Go > with the current one (as described in James Thomas blog post > http://jamesthom.as/blog/2017/06/28/serverless-swift-with-openwhisk/) and > this is the result: > > > > +--+---+--+--+--+--+--+-+--+ > > | Label | # | Avg | Med | 90% | 95% | 99% | Min | Max | > > +--+---+--+--+--+--+--+-+--+ > > | Current | 1 | 1097 | 1101 | 1169 | 1191 | 1243 | 19 | 2132 | > > | Go+Swift | 1 |4 |4 |6 |6 | 10 | 2 | 1030 | > > | TOTAL| 2 | 551 | 66 | 1148 | 1169 | 1221 | 2 | 2132 | > > +--+---+--+--+--+--+--+-+--+ > > > > To be honest I am not sure why. As far as I know, Swift support is > implemented as a read-write loop too (or at least this is what looks like > to a quick look to the code), however python is not famous to be a > performing language (and I suspect the Global Interpreter Lock may play a > role in those numbers). > > > > I did also a comparison of Go and Swift running under my new > implementation. Implemented in this way , the are basically the same speed. > > > > However it is worth to be noted that the image for Golang only is 10MB, > but if I have to add swift support you need a lot of libraries on it. I > used a docker image based on ibmcom/ubuntu-swift but it is huge (1.8G!), I > think a trimmed down version is needed. > > > > All the code is in my repo in the pipe-loop branch. Now I think I will > have to take the time to clean up the code and make it robust. > > > > > > -- > > Michele Sciabarra > > openwh...@sciabarra.com >
Re: 250 times faster swift actions with the Go server...
This is great. The use of python as the proxy was a historical convenience. Your changes are shaping up nicely; thanks for pushing it forward. -r > On Feb 22, 2018, at 6:08 AM, Michele Sciabarra > wrote: > > After spending a session of learning way more swift I ever wanted to know, I > hacked an horrible sample of Swift code implementing the Hello World as a > read-stdin-write-std-out loop. > > The code in all his ugliness I do not dare to post is here: > > https://github.com/sciabarracom/openwhisk-runtime-go/blob/pipe-loop/HelloSwift/Sources/Hello/main.swift > > However I used this example to to compare my new implementation in Go with > the current one (as described in James Thomas blog post > http://jamesthom.as/blog/2017/06/28/serverless-swift-with-openwhisk/) and > this is the result: > > +--+---+--+--+--+--+--+-+--+ > | Label | # | Avg | Med | 90% | 95% | 99% | Min | Max | > +--+---+--+--+--+--+--+-+--+ > | Current | 1 | 1097 | 1101 | 1169 | 1191 | 1243 | 19 | 2132 | > | Go+Swift | 1 |4 |4 |6 |6 | 10 | 2 | 1030 | > | TOTAL| 2 | 551 | 66 | 1148 | 1169 | 1221 | 2 | 2132 | > +--+---+--+--+--+--+--+-+--+ > > To be honest I am not sure why. As far as I know, Swift support is > implemented as a read-write loop too (or at least this is what looks like to > a quick look to the code), however python is not famous to be a performing > language (and I suspect the Global Interpreter Lock may play a role in those > numbers). > > I did also a comparison of Go and Swift running under my new implementation. > Implemented in this way , the are basically the same speed. > > However it is worth to be noted that the image for Golang only is 10MB, but > if I have to add swift support you need a lot of libraries on it. I used a > docker image based on ibmcom/ubuntu-swift but it is huge (1.8G!), I think a > trimmed down version is needed. > > All the code is in my repo in the pipe-loop branch. Now I think I will have > to take the time to clean up the code and make it robust. > > > -- > Michele Sciabarra > openwh...@sciabarra.com