@@ -371,3 +371,31 @@ function Base.getproperty(csvrow::Row{F}, ::Type{T}, col::Int, name::Symbol) whe
371371 end
372372 return r
373373end
374+
375+
376+ # code for generating various-sized csv files
377+ # used to determine the row vs. column-access threshold
378+ function gencsv (rows, cols)
379+ df = DataFrame ([round .(rand (rows), digits= 4 ) for _ ∈ 1 : cols], Symbol .([" col$i " for i ∈ 1 : cols]))
380+ CSV. write (" random_$(rows) _$(cols) .csv" , df)
381+ end
382+
383+ function go (compile= true )
384+ # for cols in (10, 25, 50, 75, 100, 250)
385+ # for rows in (10, 50, 100, 1000, 5000, 10000, 50000, 100000)
386+ # println("generating $rows by $cols csv file...")
387+ # @time gencsv(rows, cols)
388+ # end
389+ # end
390+ rt = NamedTuple{(:compiled , :rows , :cols , :time ), Tuple{Int, Int, Float64}}[]
391+ for cols in (10 , 25 , 50 , 75 , 100 , 250 )
392+ for rows in (10 , 50 , 100 , 1000 , 5000 , 10000 , 50000 , 100000 )
393+ println (" reading $rows by $cols csv file..." )
394+ e = @elapsed begin
395+ df = CSV. File (" random_$(rows) _$(cols) .csv" ) |> DataFrame;
396+ end
397+ push! (rt, (compiled= compile, rows= rows, cols= cols, time= e))
398+ end
399+ end
400+ CSV. write (" results_$compile .csv" , rt)
401+ end
0 commit comments