skyfall 0.4.0 → 0.4.1
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/CHANGELOG.md +4 -0
- data/lib/skyfall/car_archive.rb +13 -12
- data/lib/skyfall/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: 1fa2648926fdc913472ec8fca4d6bdf3bbac188dbb0d9c82816538ca0c446d23
|
4
|
+
data.tar.gz: f35348c4834fb9dc26544105074bdc4f9ba07c36d595e5c248651d47e5dc188e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df775bdf85f5fe73f5fc5f27868b4ad8755219e98dfae72a32e7a9bb66295b463f65a2ebd9a8c956d74f200f667a9f02c00310e665a506f69a950db03eec4ad6
|
7
|
+
data.tar.gz: 6dfe5acf800a9765d0ad6f3ce78e7a6aae445a2dde4028ef3af39ff81a5fc3947080ecfb0ceb0dcf439a2db3e6d65e17376b187455fa1eaf56889c87d0137be1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## [0.4.1] - 2024-10-04
|
2
|
+
|
3
|
+
- performance fix - don't decode CAR sections which aren't needed, which is most of them; this cuts the amount of memory that GC has to free up by about one third, and should speed up processing by around ~10%
|
4
|
+
|
1
5
|
## [0.4.0] - 2024-09-23
|
2
6
|
|
3
7
|
- (re)added a "hearbeat" feature (removed earlier in 0.2.0) to fix the occasional issue when the websocket stops receiving data, but doesn't disconnect (not enabled by default, turn it on by setting `check_heartbeat` to true)
|
data/lib/skyfall/car_archive.rb
CHANGED
@@ -11,11 +11,15 @@ require 'stringio'
|
|
11
11
|
|
12
12
|
module Skyfall
|
13
13
|
class CarSection
|
14
|
-
attr_reader :cid
|
14
|
+
attr_reader :cid
|
15
15
|
|
16
|
-
def initialize(cid,
|
16
|
+
def initialize(cid, body_data)
|
17
17
|
@cid = cid
|
18
|
-
@
|
18
|
+
@body_data = body_data
|
19
|
+
end
|
20
|
+
|
21
|
+
def body
|
22
|
+
@body ||= CarArchive.convert_data(CBOR.decode(@body_data))
|
19
23
|
end
|
20
24
|
end
|
21
25
|
|
@@ -37,9 +41,7 @@ module Skyfall
|
|
37
41
|
section && section.body
|
38
42
|
end
|
39
43
|
|
40
|
-
|
41
|
-
|
42
|
-
def convert_data(object)
|
44
|
+
def self.convert_data(object)
|
43
45
|
if object.is_a?(Hash)
|
44
46
|
object.each do |k, v|
|
45
47
|
if v.is_a?(Hash) || v.is_a?(Array)
|
@@ -65,14 +67,16 @@ module Skyfall
|
|
65
67
|
end
|
66
68
|
end
|
67
69
|
|
68
|
-
def make_cid_link(cid)
|
70
|
+
def self.make_cid_link(cid)
|
69
71
|
{ '$link' => CID.from_cbor_tag(cid) }
|
70
72
|
end
|
71
73
|
|
72
|
-
def make_bytes(data)
|
74
|
+
def self.make_bytes(data)
|
73
75
|
{ '$bytes' => Base64.encode64(data).chomp.gsub(/=+$/, '') }
|
74
76
|
end
|
75
77
|
|
78
|
+
private
|
79
|
+
|
76
80
|
def read_header(buffer)
|
77
81
|
len = buffer.read_varint
|
78
82
|
|
@@ -112,10 +116,7 @@ module Skyfall
|
|
112
116
|
cid = CID.new(prefix + cid_data)
|
113
117
|
|
114
118
|
body_data = sbuffer.read
|
115
|
-
|
116
|
-
convert_data(body)
|
117
|
-
|
118
|
-
@sections << CarSection.new(cid, body)
|
119
|
+
@sections << CarSection.new(cid, body_data)
|
119
120
|
end
|
120
121
|
end
|
121
122
|
end
|
data/lib/skyfall/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: skyfall
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kuba Suder
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: base32
|