Skip to content

Releases: yosiat/panko_serializer

v0.4.0

04 May 21:58
Compare
Choose a tag to compare

Changes

v0.3.9

18 Feb 21:07
Compare
Choose a tag to compare

v0.3.9

Fixed Bugs

  • Methods under the serializer definition was added as an attributes, for example:
class UserSerializer < Panko::Serializer
    attributes :id, :name

    # will be included since it's attribute
    def name
        "#{object.first_name} #{object.last_name}"
    end 

    # will be included because of the bug, shouldn't be included since there is no `attributes` definition
    def age
      21
    end 
end

v0.3.5

10 Feb 18:43
Compare
Choose a tag to compare

v0.3.5

This release includes new features!

Changes

v0.3.4

06 Jan 08:57
Compare
Choose a tag to compare

v0.3.4

This release includes bugfix and a new feature.

Changes

v0.3.3

23 Dec 11:25
Compare
Choose a tag to compare

v0.3.3

This release includes the new documentation site (https://yosiat.github.io/panko_serializer) and new features.

News

What to expect in the next release?

  • Rails integration - No need to write Panko::ArraySerializer, just render json: posts, each_serializer: PostSerializer - Issue
  • Setting context globally - For example, pass the current_user to serializer in this controller - Issue
  • Filtering keys at the serializer level - get the filters of your serializer closer to your serializer - Issue

v0.3.1

02 Dec 17:36
Compare
Choose a tag to compare

v0.3.1

This version is mostly performance improvements & refactoring of current codebase.

Features

  • Panko::JsonValue - wrapper for json values to use Panko::Response

Performance Improvements

  • Caching types in attributes - Instead of re-fetching the type of attribute every time, we cache it and invalid it based on the record class being serializer.
  • Moving attributes & associations to be backend behind C structs - and saving the name of attribute/association string and symbol to avoid necessary conversions
  • Type Casting of JSON - is now done using Oj instead of relying on AR type to do the deserialization
  • Caching serializer between runs - In method attributes, we create serializer instance, now between runs we cache it so we don't need to re-create.

We can't talk about performance improvements without showing some numbers!

Real-world benchmark:
I used the infrastructure in work and popular endpoint that serializes 7,884 entries,
here is are different between v0.2.2 and this version -

Metric v0.2.2 v0.3.1
Avg Response Time 2.10s 1.46s
Max Response Time 2.40s 1.90s
99th Response Time 2.35s 1.67s
Requests Per Second 0.47 0.68
Total Requests 142 205

the tests were done on different environment for testing only with wrk - 5 minute
Thanks to Bringg (my employer) for providing the infrastructure & data for those benchmarks.

Benchmarks:

Benchmark v0.2.2 ip/s v0.3.1 ip/s
Panko_SimpleWithMethodCall_Posts_2300 82.47 92.63
Panko_SimpleWithMethodCall_Posts_50 4,480.92 5,097.98
Panko_HasOne_Posts_2300 46.86 60.8
Panko_HasOne_Posts_50 3,040.04 3,774.9
Panko_Simple_Posts_2300 89.57 132.99
Panko_Simple_Posts_50 5,605.79 6,619.94

ran using rake sanity on my MacBook Pro (Retina, 15-inch, Mid 2015)

v0.2.0

21 Oct 12:44
Compare
Choose a tag to compare
  • Feature: supporting rails 5 (#12)

v0.1.10

14 Oct 14:33
Compare
Choose a tag to compare
  • Performance: on method fields, skip settings the context if there is no context (62954e4)
  • Bug Fix: Serializing null fields in string fields as empty string (d171997)

v0.1.9

11 Oct 16:25
Compare
Choose a tag to compare
  • Improving performance of filters (#11)

v0.1.8

29 Sep 09:47
Compare
Choose a tag to compare

Important

Fixing require for panko, Instead of requiring "panko" explicitly, now Panko will be automatically required correctly in bundler environment.