zenrpc icon indicating copy to clipboard operation
zenrpc copied to clipboard

zenrpc generate very slow

Open digitive opened this issue 6 years ago • 4 comments

Hi We love zenrpc. We just experienced the zenrpc code generator being very slow. We have a small project which about 10 methods in 2 files, which takes zenrpc more than 1 minutes to generate. And the CPU usage are very high during the generating process.

digitive avatar Dec 03 '18 01:12 digitive

@digitive could you please check new v2 version? We've made some improvements in generator.

sergeyfast avatar Mar 10 '21 18:03 sergeyfast

We are using:

github.com/semrush/zenrpc/v2 v2.1.0 h1:a6jKcimSTS2u/FkAg8qXkAcplBC9vEAInl7aQY47u7g=
github.com/semrush/zenrpc/v2 v2.1.0/go.mod h1:+o94fyVC+TvYuT5ULLyBmql+ezicEFKtsieIXSeWBqg=

Macbook Pro with SSD and CPU:

 % sysctl -n machdep.cpu.brand_string
Intel(R) Core(TM) i7-6567U CPU @ 3.30GHz

Generating 15 services in ~60 seconds:

tusk generate  60.95s user 34.96s system 172% cpu 55.478 total

smyrman avatar Mar 10 '21 19:03 smyrman

@smyrman are you using heavy imports like s3? How can we reproduce this issue? Could you provide test project?

sergeyfast avatar Mar 10 '21 19:03 sergeyfast

Hi, sorry for the late reply.

Unfortunately we do not have a reproduce code we can share for the 15 services example. At the moment, I also do not have the time to setup a reproduce test repo, but if I find the time later, I will let you know. I can mention the different services reside in different packages, so each run of zenrpc for one service in particular generally run for 14 - 24 sec depending on the service.

PS! I have no connection to @digitive. I just saw there where no update on this issue and wanted to contribute to show which numbers we are seeing in our organization to see if it's relatable.

smyrman avatar Apr 06 '21 08:04 smyrman