Commit Graph

21 Commits

Author SHA1 Message Date
xzfc
e7c445b15e Do not return error if madvise(PopulateRead) fails (#5123) 2024-09-23 17:08:41 +02:00
Andrey Vasnetsov
3bb6628bee mmap_to_type_unbounded -> mmap_prefix_to_type_unbounded (#5088) 2024-09-16 18:42:43 +02:00
Andrey Vasnetsov
e8d5cfc63c Allow explicit populate of mmap (#4923)
* expose mmap populate

* expose mmap populate in open_read_mmap

* FOR TEST, REVERSE IT: make InRamChunkedMmap default

* enable populate advise on unix

* fix clippy

* unix -> linux

* Update lib/collection/src/config.rs

* clippy fixes

* resolve conflicts

* fmt

* Runtime check for PopulateRead

---------

Co-authored-by: xzfc <xzfcpw@gmail.com>
2024-09-14 20:53:07 +02:00
Andrey Vasnetsov
b342cbca6e initial structures for reading mmap text index (#5029)
* initial structures for reading mmap text index

* creation of text index mmap

* WIP create mmap inverted index

* use same file writing technique as in MmapHashmap

* Save points_to_tokens_count in two files

* clippy

* fill slice with iterator

* review fixes

* fix after review

* implement loading of MmapInvertedIndex

* WIP: prepare for converting ChunkReader into trait

* fmt

* WIP: prepare ChunkReader to be a trai

* WIP: replace ChunkReaderImpl with trait

* implement chunk reader for mmap view

* rollback ChunkReader trait and remove CompressedMmapPostingListView

* move ImmutableInvertedIndex and MutableInvertedIndex into separate files

* impl ops for MmapInvertedIndex

* make mmap hashmap value param generic (#5042)

* make mmap hashmap value param generic

* test + fixes

* Update lib/common/common/src/mmap_hashmap.rs

Co-authored-by: Tim Visée <tim+github@visee.me>

* Update lib/common/common/src/mmap_hashmap.rs

Co-authored-by: Tim Visée <tim+github@visee.me>

* fixups

---------

Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: xzfc <xzfcpw@gmail.com>

* test and fix immutable to mmap conversion

* fix case 4 and refactor MmapBitSlice::create

* more tests

* fmt

---------

Co-authored-by: Luis Cossío <luis.cossio@outlook.com>
Co-authored-by: Tim Visée <tim+github@visee.me>
Co-authored-by: xzfc <xzfcpw@gmail.com>
2024-09-10 12:02:05 +02:00
Andrey Vasnetsov
707134b43e Refactor chunked mmaps (#4888)
* remove dependency on segment in chunked mmap

* move chunked utils to memory subcrate
2024-08-15 12:04:39 +02:00
xzfc
0e6f86bdfb InRamChunkedMmap: optimize using madvise (#4881)
* refactor: introduce AdviceSetting for open_read_mmap/open_write_mmap

* perf: use Advice::Normal in a few places

* perf: use MADV_DONTNEED after reading

* perf: use POSIX_FADV_DONTNEED after reading
2024-08-14 13:41:37 +00:00
Andrey Vasnetsov
44130a462e Mmap subcrate refactoring (#4886)
* make mmap_type independent from segment structures

* make bitvec and thiserror workspace dependencies

* move mmap_type into common/memory subcrate

* fmt
2024-08-14 11:04:56 +02:00
xzfc
a0ea3caccf Enable some of the pedantic clippy lints (#4715)
* Use workspace lints

* Enable lint: manual_let_else

* Enable lint: enum_glob_use

* Enable lint: filter_map_next

* Enable lint: ref_as_ptr

* Enable lint: ref_option_ref

* Enable lint: manual_is_variant_and

* Enable lint: flat_map_option

* Enable lint: inefficient_to_string

* Enable lint: implicit_clone

* Enable lint: inconsistent_struct_constructor

* Enable lint: unnecessary_wraps

* Enable lint: needless_continue

* Enable lint: unused_self

* Enable lint: from_iter_instead_of_collect

* Enable lint: uninlined_format_args

* Enable lint: doc_link_with_quotes

* Enable lint: needless_raw_string_hashes

* Enable lint: used_underscore_binding

* Enable lint: ptr_as_ptr

* Enable lint: explicit_into_iter_loop

* Enable lint: cast_lossless
2024-07-22 08:19:19 +00:00
xzfc
90ce6cbd01 Add MmapHashMap (#4612)
* Promote some deps to workspace deps

* Add MmapHashMap

* Review fixups

* Use tempfile for atomicity
2024-07-08 17:44:52 +00:00
Arnaud Gourlay
e1b2af1a86 Promote log dep to workspace (#4605) 2024-07-03 12:35:04 +02:00
Ivan Pleshkov
291add4d37 Atomic create_and_ensure_length (#4583)
* atomic create_and_ensure_length

* fix tests; review remarks

* review remarks

* create false flag
2024-06-29 00:50:54 +02:00
xzfc
93a42b4e2d Compressed posting lists (#4253) 2024-05-22 18:18:20 +00:00
Roman Titov
1445ab29bf Fix GraphLinksConverter::serialize_to data alignment issues (#3806)
* Assert data alignment in `transmute_from_u8*` functions

* WIP: Switch `transmute_from_u8*` alignment asserts from `debug_assert` to `assert`...

...to make sure *all* tests running on CI will enforce the alignment

* Add descriptive message to alignment assertions

* Fix alignment in graph links file (#3807)

* fix alignment in graph links file

* fix alignment while reading

* Revert "fix alignment while reading"

This reverts commit e2d1cee890.

* Revert "Revert "fix alignment while reading""

This reverts commit 7a4fdc9aea.

* small refactor

* Switch `transmute_from_u8*` alignment asserts back to `debug_assert`

Additionally:
- Remove extra `0x` from slice address in assert messages

* Trim offsets padding bytes from the end of `links_mmap` slice

---------

Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>
2024-03-13 21:09:56 +01:00
Luis Cossío
6b7fa54cf8 Fix clippy 1.77 lints: explicitly set truncate flag on file creation (#3561)
* add `truncate(true)` where unspecified

* remove unused `WriteGuard` wrapper

* Don't truncate if we explicitly set the size later

---------

Co-authored-by: timvisee <tim@visee.me>
2024-02-08 11:24:47 +01:00
Tim Visée
06712e8f4d Move common dependencies to workspace (#3490) 2024-01-31 09:01:38 +01:00
dependabot[bot]
8e5587c390 Bump memmap2 from 0.9.3 to 0.9.4 (#3484)
Bumps [memmap2](https://github.com/RazrFalcon/memmap2-rs) from 0.9.3 to 0.9.4.
- [Changelog](https://github.com/RazrFalcon/memmap2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/memmap2-rs/compare/v0.9.3...v0.9.4)

---
updated-dependencies:
- dependency-name: memmap2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-30 09:42:42 +01:00
dependabot[bot]
c1210186b0 Bump memmap2 from 0.9.2 to 0.9.3 (#3283)
Bumps [memmap2](https://github.com/RazrFalcon/memmap2-rs) from 0.9.2 to 0.9.3.
- [Changelog](https://github.com/RazrFalcon/memmap2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/memmap2-rs/compare/v0.9.2...v0.9.3)

---
updated-dependencies:
- dependency-name: memmap2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-02 11:36:14 +01:00
dependabot[bot]
f1de3b9586 Bump memmap2 from 0.9.0 to 0.9.2 (#3239)
Bumps [memmap2](https://github.com/RazrFalcon/memmap2-rs) from 0.9.0 to 0.9.2.
- [Changelog](https://github.com/RazrFalcon/memmap2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/memmap2-rs/compare/v0.9.0...v0.9.2)

---
updated-dependencies:
- dependency-name: memmap2
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-19 16:00:45 +00:00
dependabot[bot]
629e71c08d Bump memmap2 from 0.7.1 to 0.9.0 (#2999)
Bumps [memmap2](https://github.com/RazrFalcon/memmap2-rs) from 0.7.1 to 0.9.0.
- [Changelog](https://github.com/RazrFalcon/memmap2-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/RazrFalcon/memmap2-rs/compare/v0.7.1...v0.9.0)

---
updated-dependencies:
- dependency-name: memmap2
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-14 08:59:46 +01:00
Arnaud Gourlay
fc0b77636a Sparse index persistence (#2718)
* Sparse index persistence

* code review

* remove pub visibility
2023-10-04 14:39:52 +02:00
Arnaud Gourlay
840248f6fc Introduce Memory common module (#2712)
* Introduce Memory common module

* fix Windaube build

* move mmap_ops as well
2023-09-25 11:30:50 +02:00