osv 0.3.17 → 0.3.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +26 -26
- data/ext/osv/src/utils.rs +13 -9
- data/lib/osv/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: da944a5af1cc88630fe0952e6e710d2acb8ac420ae8708a107064f5ecf444dec
|
4
|
+
data.tar.gz: bd6de3860ff2f47eb03b9019d307d647fa8c2e8f366543fbe95604f284871b62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a130687fb25aaae3734f2e69c2258ccf893c584cd0c2893b751282b393ee4d52b2317a338f1ef68a864222e4947614ffdca7e6b98d8d37dc934dfede61f7bc1
|
7
|
+
data.tar.gz: 332a5dc1c6ce6df721b22f9e66b54d48426da3a0148917f9ec13036edd63e1fb70a950a2971964d289e076536af47d090c89fd95961d8ca4b51f1f1b8a221a98
|
data/README.md
CHANGED
@@ -142,34 +142,34 @@ OSV - Gzipped Direct 1.000 i/100ms
|
|
142
142
|
FastCSV - Gzipped 1.000 i/100ms
|
143
143
|
CSV - Gzipped 1.000 i/100ms
|
144
144
|
Calculating -------------------------------------
|
145
|
-
CSV - StringIO 0.
|
146
|
-
FastCSV - StringIO 0.
|
147
|
-
OSV - StringIO 0.
|
148
|
-
CSV - Hash output 0.
|
149
|
-
OSV - Hash output 0.
|
150
|
-
CSV - Array output 0.
|
151
|
-
OSV - Array output 0.
|
145
|
+
CSV - StringIO 0.083 (± 0.0%) i/s (12.06 s/i) - 3.000 in 36.304469s
|
146
|
+
FastCSV - StringIO 0.335 (± 0.0%) i/s (2.98 s/i) - 10.000 in 31.019521s
|
147
|
+
OSV - StringIO 0.705 (± 0.0%) i/s (1.42 s/i) - 21.000 in 30.629511s
|
148
|
+
CSV - Hash output 0.060 (± 0.0%) i/s (16.74 s/i) - 2.000 in 33.475977s
|
149
|
+
OSV - Hash output 0.434 (± 0.0%) i/s (2.30 s/i) - 13.000 in 30.071679s
|
150
|
+
CSV - Array output 0.063 (± 0.0%) i/s (15.88 s/i) - 2.000 in 32.229906s
|
151
|
+
OSV - Array output 0.406 (± 0.0%) i/s (2.47 s/i) - 12.000 in 31.072600s
|
152
152
|
FastCSV - Array output
|
153
|
-
0.
|
153
|
+
0.321 (± 0.0%) i/s (3.11 s/i) - 10.000 in 31.458966s
|
154
154
|
OSV - Direct Open Array output
|
155
|
-
0.
|
156
|
-
OSV - Gzipped 0.
|
157
|
-
OSV - Gzipped Direct 0.
|
158
|
-
FastCSV - Gzipped 0.
|
159
|
-
CSV - Gzipped 0.
|
155
|
+
0.686 (± 0.0%) i/s (1.46 s/i) - 21.000 in 30.639715s
|
156
|
+
OSV - Gzipped 0.524 (± 0.0%) i/s (1.91 s/i) - 16.000 in 30.695259s
|
157
|
+
OSV - Gzipped Direct 0.519 (± 0.0%) i/s (1.93 s/i) - 16.000 in 30.830005s
|
158
|
+
FastCSV - Gzipped 0.313 (± 0.0%) i/s (3.20 s/i) - 10.000 in 32.031002s
|
159
|
+
CSV - Gzipped 0.057 (± 0.0%) i/s (17.55 s/i) - 2.000 in 35.107808s
|
160
160
|
|
161
161
|
Comparison:
|
162
|
-
OSV -
|
163
|
-
|
164
|
-
OSV -
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
FastCSV -
|
169
|
-
|
170
|
-
FastCSV - Gzipped:
|
171
|
-
CSV - StringIO:
|
172
|
-
CSV - Array output:
|
173
|
-
CSV - Hash output:
|
174
|
-
CSV - Gzipped:
|
162
|
+
OSV - StringIO : 0.7 i/s
|
163
|
+
OSV - Direct Open Array output: 0.7 i/s - 1.03x slower
|
164
|
+
OSV - Gzipped : 0.5 i/s - 1.34x slower
|
165
|
+
OSV - Gzipped Direct : 0.5 i/s - 1.36x slower
|
166
|
+
OSV - Hash output : 0.4 i/s - 1.62x slower
|
167
|
+
OSV - Array output : 0.4 i/s - 1.74x slower
|
168
|
+
FastCSV - StringIO : 0.3 i/s - 2.10x slower
|
169
|
+
FastCSV - Array output : 0.3 i/s - 2.20x slower
|
170
|
+
FastCSV - Gzipped : 0.3 i/s - 2.26x slower
|
171
|
+
CSV - StringIO : 0.1 i/s - 8.50x slower
|
172
|
+
CSV - Array output : 0.1 i/s - 11.20x slower
|
173
|
+
CSV - Hash output : 0.1 i/s - 11.80x slower
|
174
|
+
CSV - Gzipped : 0.1 i/s - 12.37x slower
|
175
175
|
```
|
data/ext/osv/src/utils.rs
CHANGED
@@ -47,14 +47,14 @@ pub fn parse_read_csv_args(ruby: &Ruby, args: &[Value]) -> Result<ReadCsvArgs, E
|
|
47
47
|
_,
|
48
48
|
(),
|
49
49
|
(
|
50
|
-
Option<bool
|
51
|
-
Option<String>,
|
52
|
-
Option<String>,
|
50
|
+
Option<Option<bool>>,
|
53
51
|
Option<Option<String>>,
|
54
|
-
Option<Value>,
|
55
|
-
Option<bool>,
|
56
52
|
Option<Option<String>>,
|
57
|
-
Option<
|
53
|
+
Option<Option<String>>,
|
54
|
+
Option<Option<Value>>,
|
55
|
+
Option<Option<bool>>,
|
56
|
+
Option<Option<Option<String>>>,
|
57
|
+
Option<Option<Value>>,
|
58
58
|
),
|
59
59
|
(),
|
60
60
|
>(
|
@@ -72,11 +72,12 @@ pub fn parse_read_csv_args(ruby: &Ruby, args: &[Value]) -> Result<ReadCsvArgs, E
|
|
72
72
|
],
|
73
73
|
)?;
|
74
74
|
|
75
|
-
let has_headers = kwargs.optional.0.unwrap_or(true);
|
75
|
+
let has_headers = kwargs.optional.0.flatten().unwrap_or(true);
|
76
76
|
|
77
77
|
let delimiter = *kwargs
|
78
78
|
.optional
|
79
79
|
.1
|
80
|
+
.flatten()
|
80
81
|
.unwrap_or_else(|| ",".to_string())
|
81
82
|
.as_bytes()
|
82
83
|
.first()
|
@@ -90,6 +91,7 @@ pub fn parse_read_csv_args(ruby: &Ruby, args: &[Value]) -> Result<ReadCsvArgs, E
|
|
90
91
|
let quote_char = *kwargs
|
91
92
|
.optional
|
92
93
|
.2
|
94
|
+
.flatten()
|
93
95
|
.unwrap_or_else(|| "\"".to_string())
|
94
96
|
.as_bytes()
|
95
97
|
.first()
|
@@ -105,6 +107,7 @@ pub fn parse_read_csv_args(ruby: &Ruby, args: &[Value]) -> Result<ReadCsvArgs, E
|
|
105
107
|
let result_type = match kwargs
|
106
108
|
.optional
|
107
109
|
.4
|
110
|
+
.flatten()
|
108
111
|
.map(|value| parse_string_or_symbol(ruby, value))
|
109
112
|
{
|
110
113
|
Some(Ok(Some(parsed))) => match parsed.as_str() {
|
@@ -126,13 +129,14 @@ pub fn parse_read_csv_args(ruby: &Ruby, args: &[Value]) -> Result<ReadCsvArgs, E
|
|
126
129
|
None => String::from("hash"),
|
127
130
|
};
|
128
131
|
|
129
|
-
let flexible = kwargs.optional.5.unwrap_or_default();
|
132
|
+
let flexible = kwargs.optional.5.flatten().unwrap_or_default();
|
130
133
|
|
131
|
-
let flexible_default = kwargs.optional.6.unwrap_or_default();
|
134
|
+
let flexible_default = kwargs.optional.6.flatten().unwrap_or_default();
|
132
135
|
|
133
136
|
let trim = match kwargs
|
134
137
|
.optional
|
135
138
|
.7
|
139
|
+
.flatten()
|
136
140
|
.map(|value| parse_string_or_symbol(ruby, value))
|
137
141
|
{
|
138
142
|
Some(Ok(Some(parsed))) => match parsed.as_str() {
|
data/lib/osv/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: osv
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nathan Jaremko
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-01-
|
11
|
+
date: 2025-01-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rb_sys
|