Skip to content

Commit

Permalink
remove ZOEKT_ENABLE_LAZY_DOC_SECTIONS
Browse files Browse the repository at this point in the history
This feature has been disabled by default for a long time.

Test Plan: CI
  • Loading branch information
keegancsmith committed Jul 17, 2023
1 parent 34f694c commit 3a7001f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
3 changes: 1 addition & 2 deletions indexdata.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ type indexData struct {
docSectionsStart uint32
docSectionsIndex []uint32

runeDocSections []DocumentSection
runeDocSectionsRaw []byte
runeDocSections []DocumentSection

// rune offset=>byte offset mapping, relative to the start of the content corpus
runeOffsets runeOffsetMap
Expand Down
9 changes: 1 addition & 8 deletions matchtree.go
Original file line number Diff line number Diff line change
Expand Up @@ -989,19 +989,12 @@ func (d *indexData) newMatchTree(q query.Q, opt matchTreeOpt) (matchTree, error)
}

if substr, ok := subMT.(*substrMatchTree); ok {
// We have a feature flag for lazy decoding. If runeDocSectionsRaw is
// non-nil it means we need to lazily decode on request.
sections := d.runeDocSections
if sections == nil && d.runeDocSectionsRaw != nil {
sections = unmarshalDocSections(d.runeDocSectionsRaw, nil)
}

return &symbolSubstrMatchTree{
substrMatchTree: substr,
patternSize: uint32(utf8.RuneCountInString(substr.query.Pattern)),
fileEndRunes: d.fileEndRunes,
fileEndSymbol: d.fileEndSymbol,
sections: sections,
sections: d.runeDocSections,
}, nil
}

Expand Down
6 changes: 1 addition & 5 deletions read.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,11 +328,7 @@ func (r *reader) readIndexData(toc *indexTOC) (*indexData, error) {
return nil, err
}

if os.Getenv("ZOEKT_ENABLE_LAZY_DOC_SECTIONS") != "" {
d.runeDocSectionsRaw = blob
} else {
d.runeDocSections = unmarshalDocSections(blob, nil)
}
d.runeDocSections = unmarshalDocSections(blob, nil)

var runeOffsets, fileNameRuneOffsets []uint32

Expand Down

0 comments on commit 3a7001f

Please sign in to comment.