ReactiveX / RxCpp

Reactive Extensions for C++
Apache License 2.0
3.03k stars 390 forks source link

Reusing observables across windows #458

Open athuls opened 6 years ago

athuls commented 6 years ago

I was profiling the groupby operator implementation of RxCpp and realized it is quite sensitive to the output number of groups of groupby operation. Looking at the profile data, looks like the CPU intensive operations involve dynamically creating grouped_observables for each new group key encountered in input records. I was wondering if there is a way I can reuse these observables across windows, so that we don't end up hitting the cost of creating a new observable unless we see new keys in the subsequent windows? Basically once I issue on_completed from the source and get window output, can I reuse the data structures created from previous window?

kirkshoop commented 6 years ago

perhaps the grouping could be done before the windowing?