[Groonga-commit] groonga/groonga at d9c6db6 [master] ja: improve recycling garbage data

Back to archive index

Kouhei Sutou null+****@clear*****
Thu Mar 6 12:45:22 JST 2014


Kouhei Sutou	2014-03-06 12:45:22 +0900 (Thu, 06 Mar 2014)

  New Revision: d9c6db60bb00b723953b5472aa9b8244095db09d
  https://github.com/groonga/groonga/commit/d9c6db60bb00b723953b5472aa9b8244095db09d

  Message:
    ja: improve recycling garbage data
    
    This change increases threshold for big data mode and small data mode.
    We treated 127 (= 2 ** 7 - 1) or smaller size data as small data
    before this change. Now we treated 65535 (= 2 ** 16 - 1) or smaller
    data as small data.
    
    Small data are managed separately for each size range. For example,
    [2**0, 2**1) [2**1, 2**2), [2**2, 2**3) and so on. Each separation
    keeps datum as an array. It is easy to recycle data but it is less
    memory efficiency. For example, think [2**15, 2**16) case. It uses
    2 ** 16 size memory for 2 ** 15 + 1 size data. (2 ** 16) - (2 ** 15 +
    1) size memory isn't used. This less memory efficiency has more effect
    for range range such as [2**15, 2**16).
    
    Large data are managed as packed list. It is difficult to recycle data
    but uses memory effectively.
    
    If no data update use case, this change increases database size. This
    is a bad case. If you have many small ShortText or COLUMN_VECTOR
    columns, you may face a problem.
    
    If many small data update use case, this change keeps database
    size. This is a good case.
    
    Normally, increasing database size will be in the allowable range.

  Modified files:
    lib/store.c

  Modified: lib/store.c (+2 -2)
===================================================================
--- lib/store.c    2014-03-05 18:24:55 +0900 (64a0e64)
+++ lib/store.c    2014-03-06 12:45:22 +0900 (2a1e356)
@@ -1,5 +1,5 @@
 /* -*- c-basic-offset: 2 -*- */
-/* Copyright(C) 2009-2012 Brazil
+/* Copyright(C) 2009-2014 Brazil
 
   This library is free software; you can redistribute it and/or
   modify it under the terms of the GNU Lesser General Public
@@ -203,7 +203,7 @@ grn_ra_cache_fin(grn_ctx *ctx, grn_ra *ra, grn_id id)
 
 /**** jagged arrays ****/
 
-#define GRN_JA_W_SEGREGATE_THRESH      7
+#define GRN_JA_W_SEGREGATE_THRESH      16
 #define GRN_JA_W_CAPACITY              38
 #define GRN_JA_W_SEGMENT               22
 
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-commit mailing list
Back to archive index