Closed tyler-sommer closed 6 years ago
I am actually in favor of removing the rate limiter completely. It's only use is for XMLAPI and CREST which is retiring in May. I will see if many people are still using it or not, we could just remove it this week if not.
I actually do not see anyone on github using it. They would be calling NewEVEAPIClient
.
I still use the XML API for fetching corp information (hangars/divisions, blueprints, orders) but it looks like ESI now has this information available. I'd agree that its probably best to remove the XMLAPI altogether, that will also force me into upgrading :)
Gutted the code. Time to upgrade. 💯
Hi @antihax !
I noticed my applications were constantly using 2% CPU, so I did a little profiling with pprof and found that the rateLimiter implementation in goesi was causing the issue. Here's the top handful of rows from
top100
in go tool pprof after about 30 seconds of running:The very low tick rate (50ms for
authedThrottle
and 6.666ms foranonThrottle
) caused essentially a spinwait in thetick
method.There is a "polling" rate limiter implementation in
x
, calculating what rate limiting needs to occur whenlim.Reserve()
is called. It turned out to be a drop-in replacement -- even the test still passes. This also dropped average load in my programs to 0.0%.Let me know what you think. And as always, thanks for the excellent library!