FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
jruby/bench/bench_csv.rb at remove_deprecated_rubyhash_constructors · headius/jruby · GitHub
headius
/
jruby
Public
forked from
jruby/jruby
Notifications
You must be signed in to change notification settings
Fork
2
Star
0
Code
Pull requests
0
Actions
Projects
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
jruby
/
bench
/
bench_csv.rb
Copy path
More file actions
More file actions
Latest commit
History
History
History
32 lines (26 loc) · 654 Bytes
Breadcrumbs
jruby
/
bench
/
bench_csv.rb
Copy path
File metadata and controls
32 lines (26 loc) · 654 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# Usage: jruby csv_bench.rb {ANYTHING}?. ANYTHING old csv. nothing is new one.
if
ARGV
.
shift
puts
'Using 1.7 csv'
require_relative
'old_csv'
else
puts
'Using 9.4 csv'
require
'csv'
end
require
'benchmark'
dir
=
"data"
Dir
.
mkdir
(
dir
)
unless
Dir
.
exist?
(
dir
)
input
=
"
#{
dir
}
/extract.csv"
unless
File
.
exist?
(
input
)
Dir
.
chdir
(
dir
)
do
zip
=
"sirene_2017111_E_Q.zip"
system
"wget"
,
"-O"
,
zip
,
"http://files.data.gouv.fr/sirene/
#{
zip
}
"
system
"unzip"
,
zip
system
"head -10000 sirc* > extract.csv"
end
end
loop
do
p
Benchmark
.
realtime
{
CSV
.
foreach
(
input
,
col_sep
:
';'
,
encoding
:
"ISO-8859-1:UTF-8"
)
{
|
row
|
}
}
end
Back
|
FazBrowse Home
|
New Git URL