Replies: 2 comments
-
I did some testing and after replacing boost::property_tree with rapidjson the bot actually became slower. Another possible reason for this is the use of pointers almost in every object |
Beta Was this translation helpful? Give feedback.
-
It looks like you’re measuring time with network. Network time is volatile, so it’s not so proper comparison. But if you want to continue research, there’s a way to compare - make a lot of measurements of time and calculate percentiles (for example 95th). Percentiles help overcome volatile nature of network time. Refactor from boost to rapidjson won’t give much nor performance improvement, nor degradation, because json parsing time is nanosecond scale while network time is microsecond scale |
Beta Was this translation helpful? Give feedback.
-
Hi, guys!
I spent some time looking for C++ libraries for telegram bots and found this. After doing some tests I noticed that it's generally slower than the bot written in Python with a library I used before (python-telegram-bot). For example sending messages using tgbot-cpp takes between 0.200 and 0.280 seconds while in python it takes between 0.077 and 0.190 seconds.
Am I missing something or it's how tgbot-cpp works? (not trying to insult anyone, just wondering)
P.S. I compared a release build of the bot
P.S.S. You can notice the difference in performance as a user when waiting for the bot message
Beta Was this translation helpful? Give feedback.
All reactions