osv 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Cargo.lock +35 -7
- data/ext/osv/Cargo.toml +2 -2
- data/ext/osv/src/csv/builder.rs +7 -1
- data/ext/osv/src/csv/header_cache.rs +8 -0
- data/lib/osv/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 33c644fac6e61f8bf3b9f11e646d6706017ece2a386df03a568b5ed06fd91e2a
|
4
|
+
data.tar.gz: 0d977fb3a7eaf867663feb76161eb2d3fbe42e758523ef8cafbff51a9acfef0d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b6fe382c005837fbfc705bd02b1859fdfa9fa9f955c15f7b13ffacb97f1d5dc0714288c23a7e2431a21aada6aacb1952b33ae8d14acd019c96ed719f5580c02d
|
7
|
+
data.tar.gz: 4e7c3d783f23af709505a4c182d1ee6744c9f28226aecdf68c532ada9ffa653858bc730bfd879cfa94d8e8f7a1280c49380bb5b6f74ed16b7ac776318aa53d1b
|
data/Cargo.lock
CHANGED
@@ -2,6 +2,12 @@
|
|
2
2
|
# It is not intended for manual editing.
|
3
3
|
version = 3
|
4
4
|
|
5
|
+
[[package]]
|
6
|
+
name = "adler2"
|
7
|
+
version = "2.0.0"
|
8
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
9
|
+
checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627"
|
10
|
+
|
5
11
|
[[package]]
|
6
12
|
name = "aho-corasick"
|
7
13
|
version = "1.1.3"
|
@@ -43,12 +49,6 @@ version = "2.6.0"
|
|
43
49
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
44
50
|
checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de"
|
45
51
|
|
46
|
-
[[package]]
|
47
|
-
name = "bumpalo"
|
48
|
-
version = "3.16.0"
|
49
|
-
source = "registry+https://github.com/rust-lang/crates.io-index"
|
50
|
-
checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c"
|
51
|
-
|
52
52
|
[[package]]
|
53
53
|
name = "cexpr"
|
54
54
|
version = "0.6.0"
|
@@ -75,6 +75,15 @@ dependencies = [
|
|
75
75
|
"libloading",
|
76
76
|
]
|
77
77
|
|
78
|
+
[[package]]
|
79
|
+
name = "crc32fast"
|
80
|
+
version = "1.4.2"
|
81
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
82
|
+
checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3"
|
83
|
+
dependencies = [
|
84
|
+
"cfg-if",
|
85
|
+
]
|
86
|
+
|
78
87
|
[[package]]
|
79
88
|
name = "csv"
|
80
89
|
version = "1.3.1"
|
@@ -102,6 +111,16 @@ version = "1.13.0"
|
|
102
111
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
103
112
|
checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0"
|
104
113
|
|
114
|
+
[[package]]
|
115
|
+
name = "flate2"
|
116
|
+
version = "1.0.35"
|
117
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
118
|
+
checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c"
|
119
|
+
dependencies = [
|
120
|
+
"crc32fast",
|
121
|
+
"miniz_oxide",
|
122
|
+
]
|
123
|
+
|
105
124
|
[[package]]
|
106
125
|
name = "futures-core"
|
107
126
|
version = "0.3.31"
|
@@ -224,6 +243,15 @@ version = "0.2.1"
|
|
224
243
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
225
244
|
checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
|
226
245
|
|
246
|
+
[[package]]
|
247
|
+
name = "miniz_oxide"
|
248
|
+
version = "0.8.2"
|
249
|
+
source = "registry+https://github.com/rust-lang/crates.io-index"
|
250
|
+
checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394"
|
251
|
+
dependencies = [
|
252
|
+
"adler2",
|
253
|
+
]
|
254
|
+
|
227
255
|
[[package]]
|
228
256
|
name = "nom"
|
229
257
|
version = "7.1.3"
|
@@ -238,8 +266,8 @@ dependencies = [
|
|
238
266
|
name = "osv"
|
239
267
|
version = "0.1.0"
|
240
268
|
dependencies = [
|
241
|
-
"bumpalo",
|
242
269
|
"csv",
|
270
|
+
"flate2",
|
243
271
|
"kanal",
|
244
272
|
"magnus 0.7.1",
|
245
273
|
"rb-sys",
|
data/ext/osv/Cargo.toml
CHANGED
@@ -8,9 +8,9 @@ crate-type = ["cdylib"]
|
|
8
8
|
|
9
9
|
[dependencies]
|
10
10
|
csv = "^1.3"
|
11
|
+
flate2 = "1.0.35"
|
12
|
+
kanal = "0.1.0-pre8"
|
11
13
|
magnus = { version = "0.7", features = ["rb-sys"] }
|
12
14
|
rb-sys = "^0.9"
|
13
15
|
serde = { version = "1.0", features = ["derive"] }
|
14
16
|
serde_magnus = "0.8.1"
|
15
|
-
kanal = "0.1.0-pre8"
|
16
|
-
bumpalo = { version = "3.16.0", features = ["collections"] }
|
data/ext/osv/src/csv/builder.rs
CHANGED
@@ -3,6 +3,7 @@ use super::{
|
|
3
3
|
parser::RecordParser,
|
4
4
|
reader::{ReadImpl, RecordReader},
|
5
5
|
};
|
6
|
+
use flate2::read::GzDecoder;
|
6
7
|
use magnus::{rb_sys::AsRawValue, value::ReprValue, Error, RString, Ruby, Value};
|
7
8
|
use std::{fs::File, io::Read, marker::PhantomData, os::fd::FromRawFd, thread};
|
8
9
|
|
@@ -75,7 +76,12 @@ impl<'a, T: RecordParser + Send + 'static> RecordReaderBuilder<'a, T> {
|
|
75
76
|
format!("Failed to open file: {e}"),
|
76
77
|
)
|
77
78
|
})?;
|
78
|
-
|
79
|
+
if path.ends_with(".gz") {
|
80
|
+
let file = GzDecoder::new(file);
|
81
|
+
Ok(Box::new(file))
|
82
|
+
} else {
|
83
|
+
Ok(Box::new(file))
|
84
|
+
}
|
79
85
|
}
|
80
86
|
}
|
81
87
|
|
@@ -1,3 +1,11 @@
|
|
1
|
+
/// This module exists to avoid cloning header keys in returned HashMaps.
|
2
|
+
/// Since the underlying RString creation already involves cloning,
|
3
|
+
/// this caching layer aims to reduce redundant allocations.
|
4
|
+
///
|
5
|
+
/// Note: Performance testing on macOS showed minimal speed improvements,
|
6
|
+
/// so this optimization could be removed if any issues arise.
|
7
|
+
|
8
|
+
|
1
9
|
use std::{
|
2
10
|
collections::HashMap,
|
3
11
|
sync::{atomic::AtomicU32, LazyLock, Mutex},
|
data/lib/osv/version.rb
CHANGED