Skip to content

improve performance of the generation of unique ids

benoît chesneau requested to merge new-oid into master

instead of passing each time via a gen_server to generate an ID which were creating a bottleneck and slow down any other doc creation we now do the following:

  • worker_id is created once and kept in a separate module barrel_ts_config compiled at runtime.
  • 16 bits sequences are created using erlang:unique_integer/1 and ot incremented in a gen_server
  • instead of checking everytime if the system goes backward we do it asynchronousyly at the same interval we are storing the clock.

With these changes the barrel_id gen_server is no more which increases a lot the generation of ids.

Merge request reports