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):



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.

Attachments (0)

Change History (2)

comment:1 Changed on 01/05/2018 at 03:51:03 PM by kzar

  • Cc kzar removed

comment:2 Changed on 08/29/2019 at 05:43:52 PM by sebastian

  • Keywords closed-in-favor-of-gitlab added
  • Resolution set to rejected
  • Status changed from new to closed

Sorry, but we switched to GitLab. If this issue is still relevant, please file it again in the new issue tracker.

Add Comment

Modify Ticket

Change Properties
as closed .
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none).
Note: See TracTickets for help on using tickets.