On Wed, Sep 27, 2017 at 7:39 PM, Gyuseong jo <[email protected]> wrote:

> This is server code:
>>
>
>     def queryResult(self, request, context):
>         count = 0
>         # for index in range(0, 10000000):
>         #     count = count + index
>         while True:
>             count = count + 1
>         return None
>
> this use cpu 25%
> but this code use cpu 50%
>
>     def queryResult(self, request, context):
>         count = 0
>         # for index in range(0, 10000000):
>         #     count = count + index
>         while True:
>             print(count)
>             count = count + 1
>         return None
>
> why?
>

Probably because of the way the Python interpreter is implemented - how
much do you know on that (admittedly quite large) topic? More narrowly: how
much CPU do you think those two code snippets *should* use, and why?
-Nathaniel

-- 
You received this message because you are subscribed to the Google Groups 
"grpc.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/grpc-io.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/grpc-io/CAEOYnATqUw6qAjMT%3D_X5CuLhFu5ejnU%2BJ9v7%3DRVqBdj%2BiCkqPQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to