Opened 6 months ago

Last modified 6 weeks ago

#5138 new change

[emscripten] Convert serializing patterns.ini to C++

Reported by: trev Assignee: sergz
Priority: P2 Milestone:
Module: Core Keywords:
Cc: Blocked By: #5137
Blocking: #4122 Platform: Unknown / Cross platform
Ready: yes Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by trev)

Background

See #4122 for the rationale. We should serialize patterns.ini in C++ for better performance.

What to change

Create compiled/storage/serializer.cpp providing a Serializer class (should be exposed to JavaScript as _FilterStorage_Serializer). The parser should allocate a 64kB (?) buffer, with the pointer to the buffer being returned by its buffer property. FilterStorage.exportData (JavaScript, located in lib/filterStorage.js) should create a serializer instance and call Serializer.continue() until it returns 0 (no more data). Serializer.continue() should write output lines into the buffer (followed by newline character) until there is no more space and return the number of characters written. FilterStorage.exportData should then extract the lines and yield them.

Notes

  • The Serializer class should make a copy of the current subscriptions list when created, to avoid bogus output if something changes during export.
  • Methods FilterStorage.saveToDisk() and FilterStorage.getBackupFiles() can stay in JavaScript, without any changes.

Change History (4)

comment:1 Changed 6 months ago by trev

  • Description modified (diff)

comment:2 Changed 6 months ago by trev

  • Blocked By 5137 added
  • Blocking 4122 added
  • Description modified (diff)

comment:3 Changed 6 months ago by trev

  • Owner trev deleted

comment:4 Changed 6 weeks ago by sergz

  • Owner set to sergz
Note: See TracTickets for help on using tickets.