hajimehoshi / ebiten

Ebitengine - A dead simple 2D game engine for Go
https://ebitengine.org
Apache License 2.0
10.41k stars 635 forks source link

all: use iterators wherever possible #2991

Open hajimehoshi opened 1 month ago

hajimehoshi commented 1 month ago

Operating System

What feature would you like to be added?

https://github.com/golang/go/issues/61897

Iterators will be introduced as of Go 1.23 (hopefully). Let's replace the current APIs with it. Especially, we can replace Append* functions.

Why is this needed?

Iterators are more general than append* functions.

valyala commented 1 month ago

Iterators may be slower than append*() functions. They are also harder to understand and debug.

hajimehoshi commented 1 month ago

Could you elaborate more?

valyala commented 4 weeks ago

Sure - https://valyala.medium.com/go-evolves-in-the-wrong-direction-7dfda8a1a620

hajimehoshi commented 4 weeks ago

Thanks, but this doesn't measure the performance.

hajimehoshi commented 4 weeks ago

https://github.com/golang/go/issues/61897#issuecomment-2162653290