============ 对比基准测试 (原有实现) ============ Benchmark_Map_Old 基准测试: 原有 Mapper 方法
(b *testing.B)
| 263 | |
| 264 | // Benchmark_Map_Old 基准测试: 原有 Mapper 方法 |
| 265 | func Benchmark_Map_Old(b *testing.B) { |
| 266 | user := &BMUser{ |
| 267 | ID: 1, |
| 268 | Name: "Test User", |
| 269 | Email: "test@example.com", |
| 270 | Age: 25, |
| 271 | CreatedAt: 1704067200, |
| 272 | Status: 1, |
| 273 | Score: 95.5, |
| 274 | } |
| 275 | userDTO := &BMUserDTO{} |
| 276 | |
| 277 | b.ResetTimer() |
| 278 | for i := 0; i < b.N; i++ { |
| 279 | _ = Mapper(user, userDTO) |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | // Benchmark_MapSlice_Old 基准测试: 原有 MapperSlice 方法 |
| 284 | func Benchmark_MapSlice_Old(b *testing.B) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…