go-schwab / trader

⚡ fast unofficial schwab traderapi hook
https://pkg.go.dev/github.com/go-schwab/trader
GNU General Public License v2.0
16 stars 3 forks source link

performance testing #55

Open samjtro opened 5 months ago

samjtro commented 5 months ago

getting close to v0.9.0, so i wanted to create this so i had a place to discuss a few things related to performance.

  1. after switching from td to schwab, the ameritrade api has seemingly become much slower. request time average for the realtime quotes went from 70ms to 130ms, and that's after i did a bunch of performance improvements from the original library. im going to reach out to the traderapi team to see what they say.
  2. need to go through and do a systematic review of all of the functions. have done a lot of work very fast in the last week or so, i need to go back through and lean it up a bit.
  3. concurrency
samjtro commented 1 month ago

some runs recently:

order of func runs is:

GetQuote,
GetPriceHistory,
SearchInstrumentSimple,
SearchInstrumentFundamental,
GetMovers

stats:

-1.009476708s
-208.799691ms
-165.442786ms
-236.439221ms
-462.788052ms

-789.135529ms
-231.399972ms
-143.36283ms
-223.007094ms
-483.997315ms

-986.78133ms
-673.559541ms
-402.24593ms
-185.627724ms
-208.936681ms

-620.098662ms
-269.724182ms
-293.485668ms
-221.497027ms
-604.585281ms

-727.399638ms
-220.113417ms
-158.900829ms
-151.013811ms
-171.302781ms

-776.310697ms
-169.525777ms
-198.911752ms
-133.362815ms
-220.359516ms

-862.560958ms
-136.588136ms
-128.040554ms
-151.69149ms
-232.372541ms

-1.079733454s
-409.98866ms
-589.198171ms
-184.681922ms
-129.274547ms

-724.504385ms
-164.612044ms
-147.677826ms
-213.439986ms
-312.207622ms

-717.025888ms
-168.28715ms
-164.820146ms
-135.208586ms
-215.233996ms

-1.137372473s
-178.012898ms
-427.883841ms
-414.817386ms
-394.018676ms