MCPcopy Create free account
hub / github.com/devfeel/mapper / Benchmark_MapSlice_Old

Function Benchmark_MapSlice_Old

mapper_benchmark_test.go:284–303  ·  view source on GitHub ↗

Benchmark_MapSlice_Old 基准测试: 原有 MapperSlice 方法

(b *testing.B)

Source from the content-addressed store, hash-verified

282
283// Benchmark_MapSlice_Old 基准测试: 原有 MapperSlice 方法
284func Benchmark_MapSlice_Old(b *testing.B) {
285 users := make([]BMUser, 100)
286 for i := 0; i < 100; i++ {
287 users[i] = BMUser{
288 ID: int64(i),
289 Name: "User",
290 Email: "test@example.com",
291 Age: 25,
292 CreatedAt: 1704067200,
293 Status: 1,
294 Score: 95.5,
295 }
296 }
297 userDTOs := &[]BMUserDTO{}
298
299 b.ResetTimer()
300 for i := 0; i < b.N; i++ {
301 _ = MapperSlice(users, userDTOs)
302 }
303}

Callers

nothing calls this directly

Calls 1

MapperSliceFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…