Tarantool development patches archive
 help / color / mirror / Atom feed
From: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>
To: mechanik20051988 <mechanik20.05.1988@gmail.com>
Cc: tarantool-patches@dev.tarantool.org
Subject: Re: [Tarantool-patches] [PATCH v2 1/3] small: implement new size class evaluation
Date: Thu, 24 Dec 2020 16:13:34 +0100	[thread overview]
Message-ID: <782917c3-f21b-c0b3-05fe-1c6865051e27@tarantool.org> (raw)
In-Reply-To: <8f959e036941677f2e8a18a7aadb2b7e32e408d0.1608715671.git.mechanik20051988@gmail.com>

Thanks for the fixes!

>> Lets omit unnecessary changes. This clearly has nothing to do with
>> the functional part of the patch.
> 1. Fixed

Nope, it is not. The diff hunk is still here.

>> I don't understand. So you can make the factor smaller than it was
>> requested? What is the point in configuring the factor then?
> 9. The user configures the allocation factor, the actual factor may differ, 
>    but it depends directly on the parameter set by the user. 
>    User can choose the parameter so that it suits the real allocation factor.

But this is not the answer on the question, is it? What is the point is
making it bigger if it can get smaller in the result? And the user can't
even understand how to select the factor he actually needs. For instance,
he sets 1.5, but he has no idea what will be the final value. How can one
tune it then? How to choose the value?

> diff --git a/small/small_class.h b/small/small_class.h
> new file mode 100644
> index 0000000..0677557
> --- /dev/null
> +++ b/small/small_class.h
> @@ -0,0 +1,218 @@
> +
> +/**
> + * CHAR_BIT
> + */
> +#include <limits.h>
> +
> +/**
> + *

Unnecessary empty line.

> + * small_alloc uses a collection of mempools of different sizes.
> + * If small_alloc stores all mempools in an array then it have to determine
> + * an offset in that array where the most suitable mempool is.
> + * Let's name the offset as 'size class' and the size that the corresponding
> + * mempool allocates as 'class size'.> diff --git a/test/small_class.c b/test/small_class.c
> new file mode 100644
> index 0000000..b56cfeb
> --- /dev/null
> +++ b/test/small_class.c
> @@ -0,0 +1,176 @@
> +#include "small/small_class.h"
> +#include "unit.h"
> +#include <math.h>
> +
> +#define SZR(arr) sizeof(arr) / sizeof(arr[0])

We have lengthof() in trivia/util.h.

The test below I still don't understand in a single bit :D
But I give up, and hope Alexander L. validated all the calculations
and ensured they don't make things slower.

  reply	other threads:[~2020-12-24 15:13 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-23 13:14 [Tarantool-patches] [PATCH v2 0/3] change small allocator behavior mechanik20051988
2020-12-23 13:14 ` [Tarantool-patches] [PATCH] memtx: " mechanik20051988
2020-12-24 15:13   ` Vladislav Shpilevoy
     [not found]     ` <0076A088-8CBC-4238-9EEB-0C73EC516098@hxcore.ol>
2020-12-25  7:42       ` [Tarantool-patches] FW: " Evgeny Mekhanik
2020-12-28 12:10         ` Vladislav Shpilevoy
2020-12-23 13:14 ` [Tarantool-patches] [PATCH v2 1/3] small: implement new size class evaluation mechanik20051988
2020-12-24 15:13   ` Vladislav Shpilevoy [this message]
     [not found]     ` <A90D94B7-298A-4D1B-8134-6EE2ED45D615@hxcore.ol>
2020-12-25  7:48       ` [Tarantool-patches] FW: " Evgeny Mekhanik
2020-12-28 12:10     ` [Tarantool-patches] " Vladislav Shpilevoy
2020-12-23 13:14 ` [Tarantool-patches] [PATCH v2 2/3] test: add small allocator performance test mechanik20051988
2020-12-23 13:14 ` [Tarantool-patches] [PATCH v2 3/3] small: changed small allocator pool management mechanik20051988
2020-12-24 15:13   ` Vladislav Shpilevoy
     [not found]     ` <27E47303-4307-4713-BB8A-2427FED09DDE@hxcore.ol>
2020-12-25  7:52       ` [Tarantool-patches] FW: " Evgeny Mekhanik
2020-12-25  7:56       ` Evgeny Mekhanik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=782917c3-f21b-c0b3-05fe-1c6865051e27@tarantool.org \
    --to=v.shpilevoy@tarantool.org \
    --cc=mechanik20.05.1988@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH v2 1/3] small: implement new size class evaluation' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox