Skip to content

Add a new function DeleteOnOrig#256

Open
crowfrog wants to merge 2 commits intobuger:masterfrom
crowfrog:master
Open

Add a new function DeleteOnOrig#256
crowfrog wants to merge 2 commits intobuger:masterfrom
crowfrog:master

Conversation

@crowfrog
Copy link

@crowfrog crowfrog commented Oct 8, 2022

Description: add a new function DeleteOnOrig which can do delete operation on original slice. It will really help improve performance by reducing one memory alloc/dealloc and one whole copy per one call.

Benchmark before change:

Benchmark after change:

These is no benchmark case because no new code introduced almost.

@crowfrog
Copy link
Author

crowfrog commented Oct 9, 2022

@buger @daboyuka @AllenX2018

securityguy added a commit to securityguy/jsonparser that referenced this pull request Mar 18, 2026
…nhancements

Module renamed from github.com/buger/jsonparser to github.com/securityguy/jsonparser.

Security fixes:
- Fix GO-2026-4514: Delete() panics on malformed JSON (negative slice index DoS)
- Update Dockerfile base image from golang:1.6 to golang:1.21

Bug fixes:
- Fix EachKey failing to extract values from arrays of strings (PR buger#180)
- Remove duplicate import in parser_test.go (PR buger#263)

New APIs (all additive):
- ArrayEach callback now accepts *error for early termination; DoneError sentinel added (PR buger#134)
- DeleteOnOrig: in-place deletion variant with no allocation (PR buger#256)
- ArrayIterator: lazy closure-based array iteration (PR buger#254)
- GetRaw, EachRawKey: raw JSON byte extraction without type parsing (PR buger#250)

Other:
- go.mod bumped to go 1.18
- benchmark/go.mod updated with replace directive pointing to local module
- CLAUDE.md added for Claude Code guidance

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant