isomorfeus-ferret 0.17.2 → 0.17.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/isomorfeus_ferret_ext/benchmark.c +9 -20
- data/ext/isomorfeus_ferret_ext/benchmarks_all.h +1 -2
- data/ext/isomorfeus_ferret_ext/bm_hash.c +1 -2
- data/ext/isomorfeus_ferret_ext/brotli_dec_decode.c +4 -2
- data/ext/isomorfeus_ferret_ext/brotli_enc_encode.c +3 -2
- data/ext/isomorfeus_ferret_ext/frb_analysis.c +4 -5
- data/ext/isomorfeus_ferret_ext/frb_field_info.c +3 -4
- data/ext/isomorfeus_ferret_ext/frb_index.c +118 -125
- data/ext/isomorfeus_ferret_ext/frb_lazy_doc.c +14 -16
- data/ext/isomorfeus_ferret_ext/frb_search.c +31 -23
- data/ext/isomorfeus_ferret_ext/frb_store.c +27 -13
- data/ext/isomorfeus_ferret_ext/frb_utils.c +3 -6
- data/ext/isomorfeus_ferret_ext/frt_analysis.c +39 -46
- data/ext/isomorfeus_ferret_ext/frt_analysis.h +9 -9
- data/ext/isomorfeus_ferret_ext/frt_array.c +11 -22
- data/ext/isomorfeus_ferret_ext/frt_bitvector.h +3 -6
- data/ext/isomorfeus_ferret_ext/frt_doc_field.c +87 -0
- data/ext/isomorfeus_ferret_ext/frt_doc_field.h +26 -0
- data/ext/isomorfeus_ferret_ext/frt_document.c +4 -97
- data/ext/isomorfeus_ferret_ext/frt_document.h +2 -27
- data/ext/isomorfeus_ferret_ext/frt_except.c +8 -6
- data/ext/isomorfeus_ferret_ext/frt_except.h +1 -2
- data/ext/isomorfeus_ferret_ext/frt_field_index.c +13 -32
- data/ext/isomorfeus_ferret_ext/frt_field_index.h +0 -6
- data/ext/isomorfeus_ferret_ext/frt_field_info.c +69 -0
- data/ext/isomorfeus_ferret_ext/frt_field_info.h +49 -0
- data/ext/isomorfeus_ferret_ext/frt_field_infos.c +196 -0
- data/ext/isomorfeus_ferret_ext/frt_field_infos.h +35 -0
- data/ext/isomorfeus_ferret_ext/frt_global.c +10 -4
- data/ext/isomorfeus_ferret_ext/frt_global.h +11 -15
- data/ext/isomorfeus_ferret_ext/frt_hash.c +8 -8
- data/ext/isomorfeus_ferret_ext/frt_hash.h +1 -2
- data/ext/isomorfeus_ferret_ext/frt_hashset.c +20 -40
- data/ext/isomorfeus_ferret_ext/frt_hashset.h +1 -2
- data/ext/isomorfeus_ferret_ext/frt_helper.c +7 -15
- data/ext/isomorfeus_ferret_ext/frt_in_stream.c +35 -45
- data/ext/isomorfeus_ferret_ext/frt_in_stream.h +3 -2
- data/ext/isomorfeus_ferret_ext/frt_ind.c +20 -38
- data/ext/isomorfeus_ferret_ext/frt_index.c +292 -790
- data/ext/isomorfeus_ferret_ext/frt_index.h +1 -102
- data/ext/isomorfeus_ferret_ext/frt_lang.c +5 -10
- data/ext/isomorfeus_ferret_ext/frt_lazy_doc.c +3 -3
- data/ext/isomorfeus_ferret_ext/frt_lazy_doc.h +1 -1
- data/ext/isomorfeus_ferret_ext/frt_lazy_doc_field.c +18 -25
- data/ext/isomorfeus_ferret_ext/frt_lazy_doc_field.h +5 -5
- data/ext/isomorfeus_ferret_ext/frt_mdbx_store.c +102 -70
- data/ext/isomorfeus_ferret_ext/frt_mempool.c +8 -16
- data/ext/isomorfeus_ferret_ext/frt_multimapper.c +23 -46
- data/ext/isomorfeus_ferret_ext/frt_multimapper.h +4 -8
- data/ext/isomorfeus_ferret_ext/frt_out_stream.c +31 -43
- data/ext/isomorfeus_ferret_ext/frt_out_stream.h +2 -2
- data/ext/isomorfeus_ferret_ext/frt_posh.c +6 -819
- data/ext/isomorfeus_ferret_ext/frt_posh.h +0 -57
- data/ext/isomorfeus_ferret_ext/frt_priorityqueue.c +11 -22
- data/ext/isomorfeus_ferret_ext/frt_priorityqueue.h +1 -2
- data/ext/isomorfeus_ferret_ext/frt_q_boolean.c +85 -171
- data/ext/isomorfeus_ferret_ext/frt_q_match_all.c +8 -16
- data/ext/isomorfeus_ferret_ext/frt_q_multi_term.c +1 -2
- data/ext/isomorfeus_ferret_ext/frt_q_parser.c +49 -98
- data/ext/isomorfeus_ferret_ext/frt_q_phrase.c +52 -104
- data/ext/isomorfeus_ferret_ext/frt_q_range.c +6 -12
- data/ext/isomorfeus_ferret_ext/frt_q_span.c +113 -226
- data/ext/isomorfeus_ferret_ext/frt_q_wildcard.c +1 -2
- data/ext/isomorfeus_ferret_ext/frt_ram_store.c +134 -85
- data/ext/isomorfeus_ferret_ext/frt_search.c +82 -164
- data/ext/isomorfeus_ferret_ext/frt_similarity.c +11 -22
- data/ext/isomorfeus_ferret_ext/frt_similarity.h +1 -2
- data/ext/isomorfeus_ferret_ext/frt_store.c +13 -25
- data/ext/isomorfeus_ferret_ext/frt_store.h +86 -52
- data/ext/isomorfeus_ferret_ext/frt_term_vectors.c +8 -16
- data/ext/isomorfeus_ferret_ext/frt_win32.h +5 -10
- data/ext/isomorfeus_ferret_ext/isomorfeus_ferret.c +12 -11
- data/ext/isomorfeus_ferret_ext/isomorfeus_ferret.h +11 -13
- data/ext/isomorfeus_ferret_ext/lz4.c +422 -195
- data/ext/isomorfeus_ferret_ext/lz4.h +114 -46
- data/ext/isomorfeus_ferret_ext/lz4frame.c +421 -242
- data/ext/isomorfeus_ferret_ext/lz4frame.h +122 -53
- data/ext/isomorfeus_ferret_ext/lz4hc.c +127 -111
- data/ext/isomorfeus_ferret_ext/lz4hc.h +14 -14
- data/ext/isomorfeus_ferret_ext/lz4xxhash.h +1 -1
- data/ext/isomorfeus_ferret_ext/mdbx.c +3762 -2526
- data/ext/isomorfeus_ferret_ext/mdbx.h +115 -70
- data/ext/isomorfeus_ferret_ext/test.c +40 -87
- data/ext/isomorfeus_ferret_ext/test.h +3 -6
- data/ext/isomorfeus_ferret_ext/test_1710.c +11 -13
- data/ext/isomorfeus_ferret_ext/test_analysis.c +32 -64
- data/ext/isomorfeus_ferret_ext/test_array.c +6 -12
- data/ext/isomorfeus_ferret_ext/test_bitvector.c +12 -24
- data/ext/isomorfeus_ferret_ext/test_document.c +23 -33
- data/ext/isomorfeus_ferret_ext/test_except.c +10 -21
- data/ext/isomorfeus_ferret_ext/test_fields.c +62 -68
- data/ext/isomorfeus_ferret_ext/test_file_deleter.c +15 -23
- data/ext/isomorfeus_ferret_ext/test_filter.c +17 -27
- data/ext/isomorfeus_ferret_ext/test_global.c +14 -29
- data/ext/isomorfeus_ferret_ext/test_hash.c +19 -38
- data/ext/isomorfeus_ferret_ext/test_hashset.c +8 -16
- data/ext/isomorfeus_ferret_ext/test_helper.c +4 -8
- data/ext/isomorfeus_ferret_ext/test_highlighter.c +16 -28
- data/ext/isomorfeus_ferret_ext/test_index.c +277 -487
- data/ext/isomorfeus_ferret_ext/test_lang.c +7 -14
- data/ext/isomorfeus_ferret_ext/test_mdbx_store.c +2 -5
- data/ext/isomorfeus_ferret_ext/test_mempool.c +5 -10
- data/ext/isomorfeus_ferret_ext/test_multimapper.c +3 -6
- data/ext/isomorfeus_ferret_ext/test_priorityqueue.c +9 -18
- data/ext/isomorfeus_ferret_ext/test_q_const_score.c +4 -6
- data/ext/isomorfeus_ferret_ext/test_q_filtered.c +3 -4
- data/ext/isomorfeus_ferret_ext/test_q_fuzzy.c +9 -15
- data/ext/isomorfeus_ferret_ext/test_q_parser.c +8 -16
- data/ext/isomorfeus_ferret_ext/test_q_span.c +19 -35
- data/ext/isomorfeus_ferret_ext/test_ram_store.c +14 -13
- data/ext/isomorfeus_ferret_ext/test_search.c +60 -109
- data/ext/isomorfeus_ferret_ext/test_segments.c +8 -13
- data/ext/isomorfeus_ferret_ext/test_similarity.c +2 -4
- data/ext/isomorfeus_ferret_ext/test_sort.c +14 -24
- data/ext/isomorfeus_ferret_ext/test_store.c +96 -115
- data/ext/isomorfeus_ferret_ext/test_term.c +9 -15
- data/ext/isomorfeus_ferret_ext/test_term_vectors.c +9 -14
- data/ext/isomorfeus_ferret_ext/test_test.c +4 -8
- data/ext/isomorfeus_ferret_ext/test_threading.c +14 -20
- data/ext/isomorfeus_ferret_ext/testhelper.c +11 -21
- data/ext/isomorfeus_ferret_ext/testhelper.h +1 -1
- data/ext/isomorfeus_ferret_ext/tests_all.h +1 -2
- data/lib/isomorfeus/ferret/index/index.rb +1 -1
- data/lib/isomorfeus/ferret/version.rb +1 -1
- metadata +24 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb825b23a8f4d4422995bd20a52c24fd554c552352ba47e1af7059af60cacd33
|
4
|
+
data.tar.gz: 565707f28c6ea121d2c37b77c95d9a63f4c9a6ec663c5c0c96f59c499ca26f84
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f907b655cdb94f7b69422da855b0972229cf37170e4ede27ded73ae46c77f7e16745e5d1a86856e40bc4e73dda042dccd921fd3f2757e76b8ffbedffa33bbdb
|
7
|
+
data.tar.gz: ab559729203ecc983ab1fb32e8efa584110e4d5ea30f0ddacead13613138453287370244a4845dc01df222c5e0685537468f16a90a3c271e28b69fb8b95e5f58
|
@@ -1,6 +1,4 @@
|
|
1
1
|
#include <unistd.h>
|
2
|
-
#include <string.h>
|
3
|
-
#include "ruby.h"
|
4
2
|
#include "frt_global.h"
|
5
3
|
#include "benchmark.h"
|
6
4
|
#include "benchmarks_all.h"
|
@@ -13,14 +11,12 @@ static VALUE mBenchmark;
|
|
13
11
|
|
14
12
|
#define RUSAGE_SELF 0
|
15
13
|
|
16
|
-
struct rusage
|
17
|
-
{
|
14
|
+
struct rusage {
|
18
15
|
struct timeval ru_utime; /* user time used */
|
19
16
|
struct timeval ru_stime; /* system time used */
|
20
17
|
};
|
21
18
|
|
22
|
-
int getrusage(int who, struct rusage *rusage)
|
23
|
-
{
|
19
|
+
int getrusage(int who, struct rusage *rusage) {
|
24
20
|
FILETIME starttime;
|
25
21
|
FILETIME exittime;
|
26
22
|
FILETIME kerneltime;
|
@@ -58,8 +54,7 @@ int getrusage(int who, struct rusage *rusage)
|
|
58
54
|
#include <sys/resource.h>
|
59
55
|
#endif
|
60
56
|
|
61
|
-
static int bmtcmp(const void *p1, const void *p2)
|
62
|
-
{
|
57
|
+
static int bmtcmp(const void *p1, const void *p2) {
|
63
58
|
BenchMarkTimes *bmt1 = *(BenchMarkTimes **)p1;
|
64
59
|
BenchMarkTimes *bmt2 = *(BenchMarkTimes **)p2;
|
65
60
|
|
@@ -68,8 +63,7 @@ static int bmtcmp(const void *p1, const void *p2)
|
|
68
63
|
else return 0;
|
69
64
|
}
|
70
65
|
|
71
|
-
void bm_add(BenchMark *benchmark, bm_run_ft run, const char *name)
|
72
|
-
{
|
66
|
+
void bm_add(BenchMark *benchmark, bm_run_ft run, const char *name) {
|
73
67
|
BenchMarkUnit *unit =
|
74
68
|
(BenchMarkUnit *)frt_emalloc(sizeof(BenchMarkUnit) +
|
75
69
|
benchmark->count * sizeof(BenchMarkTimes *));
|
@@ -84,14 +78,12 @@ void bm_add(BenchMark *benchmark, bm_run_ft run, const char *name)
|
|
84
78
|
}
|
85
79
|
if (benchmark->tail) {
|
86
80
|
benchmark->tail = benchmark->tail->next = unit;
|
87
|
-
}
|
88
|
-
else {
|
81
|
+
} else {
|
89
82
|
benchmark->tail = benchmark->head = unit;
|
90
83
|
}
|
91
84
|
}
|
92
85
|
|
93
|
-
static void bm_clear(BenchMark *benchmark)
|
94
|
-
{
|
86
|
+
static void bm_clear(BenchMark *benchmark) {
|
95
87
|
BenchMarkUnit *unit, *next = benchmark->head;
|
96
88
|
while (NULL != (unit = next)) {
|
97
89
|
next = unit->next;
|
@@ -111,8 +103,7 @@ static void bm_clear(BenchMark *benchmark)
|
|
111
103
|
((double)after.tv_sec + ((double)after.tv_usec/1000000)) - \
|
112
104
|
((double)before.tv_sec + ((double)before.tv_usec/1000000))
|
113
105
|
|
114
|
-
static void bm_single_run(BenchMarkUnit *unit, BenchMarkTimes *bm_times)
|
115
|
-
{
|
106
|
+
static void bm_single_run(BenchMarkUnit *unit, BenchMarkTimes *bm_times) {
|
116
107
|
struct timeval tv_before, tv_after;
|
117
108
|
struct rusage ru_before, ru_after;
|
118
109
|
|
@@ -134,8 +125,7 @@ static void bm_single_run(BenchMarkUnit *unit, BenchMarkTimes *bm_times)
|
|
134
125
|
#define DO_SETUP(bm) if (bm->setup) bm->setup();
|
135
126
|
#define DO_TEARDOWN(bm) if (bm->teardown) bm->teardown();
|
136
127
|
|
137
|
-
static void bm_run(BenchMark *benchmark)
|
138
|
-
{
|
128
|
+
static void bm_run(BenchMark *benchmark) {
|
139
129
|
int i;
|
140
130
|
BenchMarkUnit *unit;
|
141
131
|
int max_name_len = 0;
|
@@ -171,8 +161,7 @@ static void bm_run(BenchMark *benchmark)
|
|
171
161
|
unit->final_times.stime = stime/result_count;
|
172
162
|
unit->final_times.rtime = rtime/result_count;
|
173
163
|
}
|
174
|
-
}
|
175
|
-
else {
|
164
|
+
} else {
|
176
165
|
DO_SETUP(benchmark);
|
177
166
|
for (unit = benchmark->head; unit; unit = unit->next) {
|
178
167
|
bm_single_run(unit, &(unit->final_times));
|
@@ -10,8 +10,7 @@ void bm_hash_implementations(BenchMark *bm);
|
|
10
10
|
void bm_specialized_string_hash(BenchMark *bm);
|
11
11
|
void bm_bitvector_implementations(BenchMark *bm);
|
12
12
|
|
13
|
-
const struct BenchMarkList
|
14
|
-
{
|
13
|
+
const struct BenchMarkList {
|
15
14
|
void (*initialize)(BenchMark *benchmark);
|
16
15
|
const char *name;
|
17
16
|
} all_benchmarks[] = {
|
@@ -61,8 +61,7 @@ static FrtHashEntry *h_lookup_str(FrtHash *ht, register const void *key) {
|
|
61
61
|
}
|
62
62
|
if (he->key == dummy_key) {
|
63
63
|
freeslot = he;
|
64
|
-
}
|
65
|
-
else {
|
64
|
+
} else {
|
66
65
|
if ((he->hash == hash)
|
67
66
|
&& 0 == strcmp((const char *)he->key, (const char *)key)) {
|
68
67
|
return he;
|
@@ -2033,8 +2033,10 @@ static BROTLI_NOINLINE BrotliDecoderErrorCode SafeProcessCommands(
|
|
2033
2033
|
}
|
2034
2034
|
|
2035
2035
|
BrotliDecoderResult BrotliDecoderDecompress(
|
2036
|
-
size_t encoded_size,
|
2037
|
-
uint8_t
|
2036
|
+
size_t encoded_size,
|
2037
|
+
const uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(encoded_size)],
|
2038
|
+
size_t* decoded_size,
|
2039
|
+
uint8_t decoded_buffer[BROTLI_ARRAY_PARAM(*decoded_size)]) {
|
2038
2040
|
BrotliDecoderState s;
|
2039
2041
|
BrotliDecoderResult result;
|
2040
2042
|
size_t total_out = 0;
|
@@ -1470,8 +1470,9 @@ static size_t MakeUncompressedStream(
|
|
1470
1470
|
|
1471
1471
|
BROTLI_BOOL BrotliEncoderCompress(
|
1472
1472
|
int quality, int lgwin, BrotliEncoderMode mode, size_t input_size,
|
1473
|
-
const uint8_t
|
1474
|
-
|
1473
|
+
const uint8_t input_buffer[BROTLI_ARRAY_PARAM(input_size)],
|
1474
|
+
size_t* encoded_size,
|
1475
|
+
uint8_t encoded_buffer[BROTLI_ARRAY_PARAM(*encoded_size)]) {
|
1475
1476
|
BrotliEncoderState* s;
|
1476
1477
|
size_t out_size = *encoded_size;
|
1477
1478
|
const uint8_t* input_start = input_buffer;
|
@@ -499,7 +499,7 @@ static FrtToken *cwrts_next(FrtTokenStream *ts) {
|
|
499
499
|
return frb_set_token(&(ts->token), rtoken);
|
500
500
|
}
|
501
501
|
|
502
|
-
static FrtTokenStream *cwrts_reset(FrtTokenStream *ts, char *text, rb_encoding *encoding) {
|
502
|
+
static FrtTokenStream *cwrts_reset(FrtTokenStream *ts, const char *text, rb_encoding *encoding) {
|
503
503
|
ts->t = ts->text = text;
|
504
504
|
ts->length = strlen(text);
|
505
505
|
ts->encoding = encoding;
|
@@ -643,7 +643,7 @@ static FrtToken *rets_next(FrtTokenStream *ts) {
|
|
643
643
|
}
|
644
644
|
}
|
645
645
|
|
646
|
-
static FrtTokenStream *rets_reset(FrtTokenStream *ts, char *text, rb_encoding *encoding) {
|
646
|
+
static FrtTokenStream *rets_reset(FrtTokenStream *ts, const char *text, rb_encoding *encoding) {
|
647
647
|
frt_ts_reset(ts, text, encoding);
|
648
648
|
RETS(ts)->curr_ind = 0;
|
649
649
|
return ts;
|
@@ -1139,7 +1139,7 @@ static void cwa_destroy_i(FrtAnalyzer *a) {
|
|
1139
1139
|
free(a);
|
1140
1140
|
}
|
1141
1141
|
|
1142
|
-
static FrtTokenStream *cwa_get_ts(FrtAnalyzer *a, ID field, char *text, rb_encoding *encoding) {
|
1142
|
+
static FrtTokenStream *cwa_get_ts(FrtAnalyzer *a, ID field, const char *text, rb_encoding *encoding) {
|
1143
1143
|
VALUE rstr = rb_str_new_cstr(text);
|
1144
1144
|
rb_enc_associate(rstr, encoding);
|
1145
1145
|
VALUE rts = rb_funcall(CWA(a)->ranalyzer, id_token_stream, 2, rb_str_new_cstr(rb_id2name(field)), rstr);
|
@@ -1277,8 +1277,7 @@ static VALUE frb_letter_analyzer_init(int argc, VALUE *argv, VALUE self) {
|
|
1277
1277
|
}
|
1278
1278
|
|
1279
1279
|
static VALUE
|
1280
|
-
get_rstopwords(const char **stop_words)
|
1281
|
-
{
|
1280
|
+
get_rstopwords(const char **stop_words) {
|
1282
1281
|
char **w = (char **)stop_words;
|
1283
1282
|
VALUE rstopwords = rb_ary_new();
|
1284
1283
|
|
@@ -41,16 +41,15 @@ void frb_fi_get_params(VALUE roptions, unsigned int *bits, float *boost) {
|
|
41
41
|
v = rb_hash_aref(roptions, sym_compression);
|
42
42
|
if (Qnil != v) Check_Type(v, T_SYMBOL);
|
43
43
|
if (v == sym_no || v == sym_false || v == Qfalse) {
|
44
|
-
*bits &= ~FRT_FI_IS_COMPRESSED_BM;
|
45
44
|
*bits &= ~FRT_FI_COMPRESSION_BROTLI_BM;
|
46
45
|
*bits &= ~FRT_FI_COMPRESSION_BZ2_BM;
|
47
46
|
*bits &= ~FRT_FI_COMPRESSION_LZ4_BM;
|
48
47
|
} else if (v == sym_yes || v == sym_true || v == Qtrue || v == sym_brotli) {
|
49
|
-
*bits |=
|
48
|
+
*bits |= FRT_FI_COMPRESSION_BROTLI_BM;
|
50
49
|
} else if (v == sym_bz2) {
|
51
|
-
*bits |=
|
50
|
+
*bits |= FRT_FI_COMPRESSION_BZ2_BM;
|
52
51
|
} else if (v == sym_lz4) {
|
53
|
-
*bits |=
|
52
|
+
*bits |= FRT_FI_COMPRESSION_LZ4_BM;
|
54
53
|
} else if (v == Qnil) {
|
55
54
|
/* leave as default */
|
56
55
|
} else {
|