======================================== Performance Tests ========================================
(b *testing.B)
| 261 | // ======================================== |
| 262 | |
| 263 | func BenchmarkSepDetect_Comma(b *testing.B) { |
| 264 | sd := sepDetecor{} |
| 265 | lines := []string{ |
| 266 | "Name,Age,City,Country,Score", |
| 267 | "Alice,30,NYC,USA,95", |
| 268 | "Bob,25,LA,USA,87", |
| 269 | "Charlie,35,Chicago,USA,92", |
| 270 | } |
| 271 | |
| 272 | b.ResetTimer() |
| 273 | for i := 0; i < b.N; i++ { |
| 274 | sd.sepDetect(lines) |
| 275 | } |
| 276 | } |
| 277 | |
| 278 | func BenchmarkCountRuneFast(b *testing.B) { |
| 279 | s := "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z" |