Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

The case BenchmarkRange seems has some problem ?

Open
#10 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
40/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Domain
testing

Research direction

Look at the benchmark code in the issue; the map is empty because the setup function is nil. Find the benchmark file (likely in the repository root or a test directory) and examine the BenchmarkRange test. Check how the map is populated before the timer starts. The fix is to add proper setup to fill the map with data before b.ResetTimer(). Run the benchmark to verify the results are realistic.

Written by the indexing model from the issue text.

Description

// syncmap code:
	b.Run(fmt.Sprintf("%T", &IntMap{}), func(b *testing.B) {
		m := &IntMap{}
		// setup:

		// reset:
		b.ResetTimer()

		// perG:
		perG := func(b *testing.B, pb *testing.PB, i int, m *IntMap) {
			for ; pb.Next(); i++ {
				m.Range(func(_, _ int) bool { return true })
			}
		}
		var i int64
		b.RunParallel(func(pb *testing.PB) {
			id := int(atomic.AddInt64(&i, 1) - 1)
			perG(b, pb, id*b.N, m)
		})
	})

seems the setup function is nil, then the map is empy, so at the benrchmark result, it seems vary fast

Dominant language
Go
Stars
257
Forks
17
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from a8m/syncmap

All issues in a8m/syncmap

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.