Skip to content

Conversation

@huntergregory
Copy link
Contributor

Estimated 50-75% improvement in latency from experiments. Previously used regex and now use strings to parse ipset save files.

Hoping to reduce memory usage as well by not using regex.

@huntergregory huntergregory added the npm Related to NPM. label Dec 16, 2021
ipsetIPPortHashString = ipsetIPPortHashFlag
lengthForSuccessfulMatch = 2
createStringWithSpace = "create "
lenCreateStringWithSpace = len(createStringWithSpace)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We only use these lengths once right ? do we need constants for that ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed these

lineAfterAdd := string(line[lenAddStringWithSpace:])
spaceSplitLineAfterAdd := strings.Split(lineAfterAdd, space)
parent := spaceSplitLineAfterAdd[0]
fmt.Println("DEBUGME", prefixedName, parent, hashedName)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you might want to clean these later ?

@huntergregory huntergregory merged commit 71a8dd8 into master Dec 20, 2021
@huntergregory huntergregory deleted the improve-linux-ipset-perf branch December 20, 2021 19:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

npm Related to NPM.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants