panko_serializer 0.7.4 → 0.7.7
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/.github/workflows/docs.yml +2 -2
- data/.github/workflows/ruby.yml +10 -7
- data/Gemfile +3 -12
- data/docs/docs/introduction.md +1 -1
- data/docs/docs/performance.md +6 -6
- data/docs/package-lock.json +16058 -3702
- data/docs/package.json +1 -1
- data/ext/panko_serializer/attributes_writer/attributes_writer.c +3 -5
- data/ext/panko_serializer/attributes_writer/attributes_writer.h +1 -1
- data/ext/panko_serializer/attributes_writer/type_cast/type_cast.c +16 -0
- data/ext/panko_serializer/panko_serializer.c +9 -2
- data/ext/panko_serializer/serialization_descriptor/association.c +1 -0
- data/ext/panko_serializer/serialization_descriptor/attribute.c +1 -0
- data/ext/panko_serializer/serialization_descriptor/serialization_descriptor.c +1 -1
- data/lib/panko/serializer.rb +10 -2
- data/lib/panko/serializer_resolver.rb +29 -15
- data/lib/panko/version.rb +1 -1
- data/panko_serializer.gemspec +2 -1
- metadata +26 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a55772372c4ae9e4d147a131c5dd59090b7dc928adc5e6830403246918fdb90b
|
4
|
+
data.tar.gz: e6ee39b058b87b81d19385d4ae03fb938e2c04859641499454ca7debe99aceb9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: eac9a9cad9ca9b99146527c25a935347b51a110ab36b0bc58165c961780415068c9899ebbe15ec3eb594a112d18665c54b5d5afd77ebd2449b078faa85e37981
|
7
|
+
data.tar.gz: 87081d7cc24b5a69b3c409232abedb79daab75c263aea45b405d24ef71570df0c10f8821a741f88bb4e690d38b802bd6f43a82c0cee4a5e24d0ebba04849318a
|
data/.github/workflows/docs.yml
CHANGED
@@ -19,14 +19,14 @@ jobs:
|
|
19
19
|
- name: Use Node.js ${{ matrix.node-version }}
|
20
20
|
uses: actions/setup-node@v1
|
21
21
|
with:
|
22
|
-
node-version: '
|
22
|
+
node-version: '16.x'
|
23
23
|
|
24
24
|
- name: Install Dependencies
|
25
25
|
working-directory: ${{ env.working_directory }}
|
26
26
|
run: npm install
|
27
27
|
|
28
28
|
- name: Install SSH Client 🔑
|
29
|
-
uses: webfactory/ssh-agent@v0.
|
29
|
+
uses: webfactory/ssh-agent@v0.4.1
|
30
30
|
with:
|
31
31
|
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
|
32
32
|
|
data/.github/workflows/ruby.yml
CHANGED
@@ -9,21 +9,24 @@ jobs:
|
|
9
9
|
strategy:
|
10
10
|
fail-fast: false
|
11
11
|
matrix:
|
12
|
-
ruby: [
|
13
|
-
rails: ['
|
12
|
+
ruby: ['2.6', '2.7', '3.0', '3.1.0']
|
13
|
+
rails: ['6.0.0', '6.1.0', '7.0.0']
|
14
|
+
exclude:
|
15
|
+
- ruby: '2.6'
|
16
|
+
rails: '7.0.0'
|
14
17
|
|
15
18
|
steps:
|
16
19
|
- uses: actions/checkout@v2
|
17
20
|
- name: Set up Ruby ${{ matrix.ruby }}
|
18
|
-
uses:
|
21
|
+
uses: ruby/setup-ruby@v1
|
19
22
|
with:
|
20
23
|
ruby-version: ${{ matrix.ruby }}
|
21
|
-
|
24
|
+
|
22
25
|
- name: Install deps
|
23
26
|
run: |
|
24
27
|
sudo apt update -y
|
25
28
|
sudo apt install -y libsqlite3-dev
|
26
|
-
|
29
|
+
|
27
30
|
- name: Gems Cache
|
28
31
|
id: gem-cache
|
29
32
|
uses: actions/cache@v1
|
@@ -32,7 +35,7 @@ jobs:
|
|
32
35
|
key: ${{ runner.os }}-${{ matrix.ruby }}-${{ matrix.rails }}-gem
|
33
36
|
restore-keys: |
|
34
37
|
${{ runner.os }}-${{ matrix.ruby }}-${{ matrix.rails }}-gem
|
35
|
-
|
38
|
+
|
36
39
|
- name: Install gems
|
37
40
|
env:
|
38
41
|
RAILS_VERSION: ${{ matrix.rails }}
|
@@ -40,7 +43,7 @@ jobs:
|
|
40
43
|
gem install bundler
|
41
44
|
bundle config set path 'vendor/bundle'
|
42
45
|
bundle check || bundle install --jobs 4 --retry 3
|
43
|
-
|
46
|
+
|
44
47
|
- name: Compile & test
|
45
48
|
env:
|
46
49
|
RAILS_VERSION: ${{ matrix.rails }}
|
data/Gemfile
CHANGED
@@ -3,7 +3,7 @@ source "https://rubygems.org"
|
|
3
3
|
|
4
4
|
gemspec
|
5
5
|
|
6
|
-
raw_rails_version = ENV.fetch("RAILS_VERSION", "
|
6
|
+
raw_rails_version = ENV.fetch("RAILS_VERSION", "6.1.0")
|
7
7
|
rails_version = "~> #{raw_rails_version}"
|
8
8
|
|
9
9
|
gem "activesupport", rails_version
|
@@ -12,17 +12,8 @@ gem "activerecord", rails_version, group: :test
|
|
12
12
|
|
13
13
|
|
14
14
|
group :benchmarks do
|
15
|
-
|
16
|
-
|
17
|
-
else
|
18
|
-
gem "sqlite3", "~> 1.4"
|
19
|
-
end
|
20
|
-
|
21
|
-
if raw_rails_version.include? "4.2"
|
22
|
-
gem "pg", "~> 0.15"
|
23
|
-
else
|
24
|
-
gem "pg", ">= 0.18", "< 2.0"
|
25
|
-
end
|
15
|
+
gem "sqlite3", "~> 1.4"
|
16
|
+
gem "pg", ">= 0.18", "< 2.0"
|
26
17
|
|
27
18
|
gem "memory_profiler"
|
28
19
|
gem "ruby-prof", platforms: [:mri]
|
data/docs/docs/introduction.md
CHANGED
@@ -6,7 +6,7 @@ sidebar_label: Introduction
|
|
6
6
|
|
7
7
|
Panko is library which is inspired by ActiveModelSerializers 0.9 for serializing ActiveRecord/Ruby objects to JSON strings, fast.
|
8
8
|
|
9
|
-
To achieve it's [performance](https://panko
|
9
|
+
To achieve it's [performance](https://panko.dev/docs/performance.html):
|
10
10
|
|
11
11
|
* Oj - Panko relies Oj since it's fast and allow to to serialize incrementally using `Oj::StringWriter`
|
12
12
|
* Serialization Descriptor - Panko computes most of the metadata ahead of time, to save time later in serialization.
|
data/docs/docs/performance.md
CHANGED
@@ -8,15 +8,15 @@ The performance of Panko is measured using microbenchmarks and load testing.
|
|
8
8
|
|
9
9
|
## Microbenchmarks
|
10
10
|
|
11
|
-
The following microbenchmarks are run on MacBook Pro (
|
12
|
-
demonstrating the performance of ActiveModelSerializers 0.10.
|
11
|
+
The following microbenchmarks are run on MacBook Pro (16-inch, 2021, M1 Max), Ruby 3.1.1 with Rails 7.0.2.3
|
12
|
+
demonstrating the performance of ActiveModelSerializers 0.10.13 and Panko 0.7.6
|
13
13
|
|
14
14
|
| Benchmark | AMS ip/s | Panko ip/s |
|
15
15
|
| ----------------- | -------- | ---------- |
|
16
|
-
| Simple_Posts_2300 |
|
17
|
-
| Simple_Posts_50 |
|
18
|
-
| HasOne_Posts_2300 |
|
19
|
-
| HasOne_Posts_50 |
|
16
|
+
| Simple_Posts_2300 | 11.15 | 489.71 |
|
17
|
+
| Simple_Posts_50 | 517.85 | 21,366.93 |
|
18
|
+
| HasOne_Posts_2300 | 5.68 | 229.57 |
|
19
|
+
| HasOne_Posts_50 | 268.14 | 10,126.33 |
|
20
20
|
|
21
21
|
## Real-world benchmark
|
22
22
|
|