func BenchmarkRegister(b *testing.B) {
	entities := setupEntities()
	mappers := map[unit.TypeName]unit.DataMapper{
		unit.TypeNameOf(Foo{}): NoOpDataMapper{},
	}
	b.StopTimer()
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		unit, err := unit.New(unit.DataMappers(mappers))
		if err != nil {
			b.FailNow()
		}
		b.StartTimer()
		if err = unit.Register(entities...); err != nil {
			b.FailNow()
		}
		b.StopTimer()
	}
}
BenchmarkRegister benchmarks the Register method for work units.
package work_test
import (
	"context"
	"testing"
	"github.com/freerware/work/v4/unit"
)
const EntityCount = 500
func setupEntities() (entities []interface{}) {
	for idx := 0; idx < EntityCount; idx++ {
		entities = append(entities, Foo{ID: idx})
	}
	return
}