Skip to content
Snippets Groups Projects
  1. Aug 26, 2022
    • Nikita Pettik's avatar
      perf: introduce Light benchmark · 9818bba4
      Nikita Pettik authored
      Benchmark is implemented using Google Benchmark lib. Here's benchmark
      settings:
       - values: we use structure (tuple) containing pointer to heap memory
                 and size (all payload is of the same size - 32 bytes);
       - keys: unsigned char (first byte in the tuple memory);
       - hash function: FNV-1a;
       - value comparator: std::memcmp();
       - value count: 10k - 100k - 1M
      
      Before each test we prepare vector of tuples storing truly random
      values.
      
      Here's the list of results obtained on my PC (i7-8700 12 X 4600 MHz):
      
      Insertions: ~20-12M per second;
      Find (no misses): ~58-16M* per second (find by key gives the same result);
      Find (many misses): ~84-30M per second;
      Iteration with dereference: ~450M per second;
      Insertions after erase: ~50-17M* per second;
      Find after erase: ~52-17M* per second (the same as without erase);
      Delete: ~32-8M* per second.
      
      * The first value is for 10k values in hash table; second - is for 1M.
      
      Just to have some baseline here results for quite similar benchmark for
      std::unordered_map (it is also included in source file):
      
      Insertions: ~26-8M per second;
      Find (no misses): ~44-11M per second;
      Iteration with dereference: ~265-56M per second;
      Find after erase: ~37-13M per second.
      
      Part of #7338
      
      NO_TEST=<Benchmark>
      NO_DOC=<Benchmark>
      NO_CHANGELOG=<Benchmark>
      9818bba4
    • Nikita Pettik's avatar
      perf: use C++ 14 standard · e48835fd
      Nikita Pettik authored
      There are a lot of pretty things introduced in 14 standard,
      so let's use it.
      
      NO_DOC=<Build change>
      NO_TEST=<Build change>
      NO_CHANGELOG=<Build change>
      e48835fd
    • Nikita Pettik's avatar
      perf: move debug warning to a separate header · 0a7764a7
      Nikita Pettik authored
      It's useful and can be used in all performance tests, so let's move it
      to a separate header.
      
      NO_TEST=<Refactoring>
      NO_DOC=<Refactoring>
      NO_CHANGELOG=<Refactoring>
      0a7764a7
  2. Jun 28, 2022
    • Nikita Pettik's avatar
      tuple: refactor flags · 9da70207
      Nikita Pettik authored
      Before this patch struct tuple had two boolean bit fields: is_dirty and
      has_uploaded_refs. It is worth mentioning that sizeof(boolean) is
      implementation depended. However, in code it is assumed to be 1 byte
      (there's static assertion restricting the whole struct tuple size by 10
      bytes). So strictly speaking it may lead to the compilation error on
      some non-conventional system. Secondly, bit fields anyway consume at
      least one size of type (i.e. there's no space benefits in using two
      uint8_t bit fields - they anyway occupy 1 byte in total). There are
      several known pitfalls concerning bit fields:
       - Bit field's memory layout is implementation dependent;
       - sizeof() can't be applied to such members;
       - Complier may raise unexpected side effects
         (https://lwn.net/Articles/478657/).
      
      Finally, in our code base as a rule we use explicit masks:
      txn flags, vy stmt flags, sql flags, fiber flags.
      
      So, let's replace bit fields in struct tuple with single member called
      `flags` and several enum values corresponding to masks (to be more
      precise - bit positions in tuple flags).
      
      NO_DOC=<Refactoring>
      NO_CHANGELOG=<Refactoring>
      NO_TEST=<Refactoring>
      9da70207
  3. May 18, 2022
    • Serge Petrenko's avatar
      replication: fix race in accessing vclock by applier and tx threads · ddec704e
      Serge Petrenko authored
      When applier ack writer was moved to applier thread, it was overlooked
      that it would start sharing replicaset.vclock between two threads.
      
      This could lead to the following replication errors on master:
      
       relay//102/main:reader V> Got a corrupted row:
       relay//102/main:reader V> 00000000: 81 00 00 81 26 81 01 09 02 01
      
      Such a row has an incorrectly-encoded vclock: `81 01 09 02 01`.
      When writer fiber encoded the vclock length (`81`), there was only one
      vclock component: {1: 9}, but at the moment of iterating over the
      components, another WAL write was reported to TX thread, which bumped
      the second vclock component {1: 9, 2: 1}.
      
      Let's fix the race by delivering a copy of current replicaset vclock to
      the applier thread.
      
      Also add a perf test to the perf/ directory.
      
      Closes #7089
      Part-of tarantool/tarantool-qa#166
      
      NO_DOC=internal fix
      NO_TEST=hard to test
      ddec704e
  4. Mar 24, 2022
    • Aleksandr Lyapunov's avatar
      box: introduce a pair of tuple_format_new helpers · 4b8dc6b7
      Aleksandr Lyapunov authored
      tuple_format_new has lots of arguments, all of them necessary
      indeed. But a small analysss showed that almost always there are
      only two kinds of usage of that function: with lots of zeros as
      arguments and lots of values taken from space_def.
      
      Make two versions of tuple_format_new:
      simple_tuple_format_new, with all those zeros omitted, and
      space_tuple_format_new, that takes space_def as an argument.
      
      NO_DOC=refactoring
      NO_CHANGELOG=refactoring
      4b8dc6b7
  5. Mar 23, 2022
  6. Mar 03, 2022
    • mechanik20051988's avatar
      alter: implement ability to set compression for tuple fields · a51313a4
      mechanik20051988 authored
      Implement ability to set compression for tuple fields. Compression type
      for tuple fields is set in the space format, and can be set during space
      creation or during setting of a new space format.
      ```lua
      format = {{name = 'x', type = 'unsigned', compression = 'none'}}
      space = box.schema.space.create('memtx_space', {format = format})
      space:drop()
      space = box.schema.space.create('memtx_space')
      space:format(format)
      ```
      For opensource build only one compression type ('none') is
      supported. This type of compression means its absence, so
      it doesn't affect something.
      
      Part of #2695
      
      NO_CHANGELOG=stubs for enterprise version
      NO_DOC=stubs for enterprise version
      a51313a4
  7. Feb 03, 2022
    • mechanik20051988's avatar
      test: fix incorrect resource release · 438ce64e
      mechanik20051988 authored
      There were two problems with resource release in performance test:
      - because of manually zeroing of `box_tuple_last`, tuple_format
        structure was not deleted. `box_tuple_last` should be zeroed in
        `tuple_free` function.
      - invalid loop for resource release in one of the test cases.
      This patch fix both problems.
      
      NO_CHANGELOG=test fix
      NO_DOC=test fix
      438ce64e
  8. Dec 09, 2021
  9. Aug 18, 2021
  10. Aug 12, 2021
Loading