5 ms·
"Assume I receive 100,000 trades per second from some crypo exchange and if one trade triggers 100 signals than I have 10.000.000 signals per second that is som
by xbar 4y ago
"Assume I receive 100,000 trades per second from some crypo exchange and if one trade triggers 100 signals than I have 10.000.000 signals per second that is something comparable with the maximum."
Computers work faster than people who click manually.
- smiddereens 4y ago
- halter73 4y agoWhy would you use QT signals for that? The point is you do not have to interact with the UI at that high of a frequency.
- dekhn 4y agoThis really sounds like a naive implementation expecting that naive use of a feature is perfectly optimized. IE, don't use that number of signals, or treat signals like a broadcasting message bus. 10X the cost of a virtual function call is pretty optimized, btw.
- skrebbel 4y agoI strongly doubt the signals, even at 10x a virtual function call, are a bottleneck when handling 100k network requests in a second. When you're optimizing that deep, you can do that extra bit of work and replace the qt signal library by a real vtable. It's not what signals were designed for.
- marcodiego 4y agoIf you're using signals for anything that may reach "10.000.000 signals per second" then you're doing it wrong. Sounds like the guy who wanted an event to be fired for each audio sample and required 44100 samples per second. Interestingly, qt signals maybe even fast enough for just that.
- dale_glass 4y agoAt some point you have to consider whether your way of doing things is at all sensible. Signals are good for rare, unpredictable events. If you have a firehose worth of data coming in, you're not sitting around waiting very often. Your data probably also has some commonality to it, and can be handled in bulk. If you have 100K events coming in, they're probably events of the same type. Just like if you're writing gigabytes to a file, a program written with the most minimum amount of intelligence isn't going to do it one character at a time.
- saidinesh5 4y agoEven if you are getting 100,000 events per second - your GUI only updates at 60fps or 120fps - so you'd want to batch those events and try to update the GUI only once every frame. Also to process important incoming messages on the same thread as the main event loop - where other things like user input, application drawing is handled, is kind of a bad idea.