Skip to content
This repository has been archived by the owner on Sep 23, 2023. It is now read-only.

Commit

Permalink
Merge branch 'e35_sharded_bloom_ef' into e35
Browse files Browse the repository at this point in the history
  • Loading branch information
AskAlexSharov committed Sep 18, 2023
2 parents 433dbe8 + 4a67e92 commit 26acc4e
Show file tree
Hide file tree
Showing 39 changed files with 1,099 additions and 408 deletions.
1 change: 1 addition & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
version: v1.54
skip-build-cache: true

- name: Lint source code licenses
if: matrix.os == 'ubuntu-20.04'
Expand Down
3 changes: 3 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
run:
deadline: 10m
build-tags:
- nosqlite
- noboltdb

linters:
presets:
Expand Down
32 changes: 32 additions & 0 deletions common/dbg/experiments.go
Original file line number Diff line number Diff line change
Expand Up @@ -313,3 +313,35 @@ func NoPrune() bool {
})
return noPrune
}

var (
snMadvNormal bool
snMadvNormalOnce sync.Once
)

func SnMadvNormal() bool {
snMadvNormalOnce.Do(func() {
v, _ := os.LookupEnv("SN_MADV_NORMAL")
if v == "true" {
snMadvNormal = true
log.Info("[Experiment]", "SN_MADV_NORMAL", snMadvNormal)
}
})
return snMadvNormal
}

var (
mdbxLockInRam bool
mdbxLockInRamOnce sync.Once
)

func MdbxLockInRam() bool {
mdbxLockInRamOnce.Do(func() {
v, _ := os.LookupEnv("MDBX_LOCK_IN_RAM")
if v == "true" {
mdbxLockInRam = true
log.Info("[Experiment]", "MDBX_LOCK_IN_RAM", mdbxLockInRam)
}
})
return mdbxLockInRam
}
6 changes: 5 additions & 1 deletion compress/decompress.go
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,11 @@ func (d *Decompressor) DisableReadAhead() {
}
leftReaders := d.readAheadRefcnt.Add(-1)
if leftReaders == 0 {
_ = mmap.MadviseRandom(d.mmapHandle1)
if dbg.SnMadvNormal() {
_ = mmap.MadviseNormal(d.mmapHandle1)
} else {
_ = mmap.MadviseRandom(d.mmapHandle1)
}
} else if leftReaders < 0 {
log.Warn("read-ahead negative counter", "file", d.FileName())
}
Expand Down
Loading

0 comments on commit 26acc4e

Please sign in to comment.