Opened on 12/27/2017 at 01:02:32 PM
Closed on 08/29/2019 at 05:43:52 PM
#6222 closed change (rejected)
[emscripten] Consider using of Copy-on-Write for Filter and Subscription classes
Reported by: | sergz | Assignee: | |
---|---|---|---|
Priority: | Unknown | Milestone: | |
Module: | Core | Keywords: | closed-in-favor-of-gitlab |
Cc: | hfiguiere | Blocked By: | |
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | no | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description
Background
Beside simplifying the architecture and reducing the number of places for bugs it has a real demand backed by performance requirements. Sometimes we need a frozen state of a Subscription object, including its list of filters, e.g. in order to properly serialize it (#5138). On the other hand, Filter classes are supposed to be immutable by design because a Filter object can be only constructed from a string and cannot be modified afterwards. For subscriptions it's similar, in particular for mostly used DownloadableSubscription.
However current JS Filter classes have setters for hitCount and lastHit, and emscripten Subscription has mutable listed property.
What to do
Firstly we need to decide what is more important for us, then take into account the consequences of each approach and document how and why we plan to implement it then do it.
Additional notes
- Since there is no need for allocation of a wrapper around internally held pointer, we might want to not operate by something like FilterPtr but rather just Filter in C++ interface and the corresponding JS bindings should be aware about it.
- Take into account thread-safeness, const methods as well as CoW should be thread safe in the native applications.
Sorry, but we switched to GitLab. If this issue is still relevant, please file it again in the new issue tracker.