Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arrayeach early termination #134

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

xphil
Copy link

@xphil xphil commented Apr 16, 2018

Description: What this PR does
Added ability to terminate ArrayEach() from within its callback, by setting error to some value.
Previous implementation didn't make much sense, since error was always nil.

Benchmark before change:
Benchmark is currently broken, but this fix should not change benchmark times in any way. Might fix benchmark later.

Benchmark after change:

For running benchmarks use:

go test -test.benchmem -bench JsonParser ./benchmark/ -benchtime 5s -v
# OR
make bench (runs inside docker)

Added ability to terminate ArrayEach() from within its callback, by setting
error to some value.
Previous implementation didn't make much sense, since error was always nil.
@jlhawn
Copy link

jlhawn commented Nov 13, 2018

@xphil I just noticed this PR, after I opened #156

What do you think of that patch? It's a similar goal as this one except it has the callback return an error. I also fixed the benchmarks to get them to run again.

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.

2 participants