Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] 1.0.0 release #64

Merged
merged 19 commits into from
Feb 11, 2018
Merged

[WIP] 1.0.0 release #64

merged 19 commits into from
Feb 11, 2018

Conversation

nesaulov
Copy link
Owner

@nesaulov nesaulov commented Jan 26, 2018

#63

What is done

  • Keyword arguments were replaced with normal arguments
  • Added dynamically built and included module that holds methods from json_schema for classes that inherit from Surrealist::Serializer

TODO

  • Add benchmarks for associations
  • See how else performance could be improved
  • Update README with ORMs section
  • Update ROADMAP

@nesaulov nesaulov changed the title 1.0.0 release [WIP] 1.0.0 release Jan 26, 2018
@nesaulov nesaulov added this to the 1.0.0 milestone Jan 26, 2018
@nesaulov
Copy link
Owner Author

nesaulov commented Jan 26, 2018

Right now we have this (ruby 2.4.2):

Warming up --------------------------------------
       AMS: instance   808.000  i/100ms
Surrealist: instance through .surrealize
                         1.960k i/100ms
Surrealist: instance through Surrealist::Serializer
                         1.630k i/100ms
Calculating -------------------------------------
       AMS: instance      6.816k (±16.3%) i/s -     33.128k in   5.010265s
Surrealist: instance through .surrealize
                         19.085k (± 9.7%) i/s -     96.040k in   5.088542s
Surrealist: instance through Surrealist::Serializer
                         17.679k (± 7.3%) i/s -     88.020k in   5.005971s

Comparison:
Surrealist: instance through .surrealize:    19085.2 i/s
Surrealist: instance through Surrealist::Serializer:    17679.4 i/s - same-ish: difference falls within error
       AMS: instance:     6815.9 i/s - 2.80x  slower

---

Warming up --------------------------------------
     AMS: collection     1.000  i/100ms
Surrealist: collection through Surrealist.surrealize_collection()
                         1.000  i/100ms
Surrealist: collection through Surrealist::Serializer
                         1.000  i/100ms
Calculating -------------------------------------
     AMS: collection      4.344  (±23.0%) i/s -     22.000  in   5.152137s
Surrealist: collection through Surrealist.surrealize_collection()
                          3.913  (± 0.0%) i/s -     20.000  in   5.128616s
Surrealist: collection through Surrealist::Serializer
                          3.347  (± 0.0%) i/s -     17.000  in   5.092593s

Comparison:
     AMS: collection:        4.3 i/s
Surrealist: collection through Surrealist.surrealize_collection():        3.9 i/s - same-ish: difference falls within error
Surrealist: collection through Surrealist::Serializer:        3.3 i/s - same-ish: difference falls within error

x.compare!
end


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank line detected.

x.compare!
end


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extra blank line detected.

Repository owner deleted a comment from houndci-bot Jan 27, 2018
Repository owner deleted a comment from houndci-bot Jan 27, 2018
Repository owner deleted a comment from houndci-bot Jan 27, 2018
Repository owner deleted a comment from houndci-bot Jan 27, 2018
@nesaulov
Copy link
Owner Author

Progress:

# ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]
# -- Instance --
# Comparison:
#   Surrealist: instance through .surrealize:    22068.7 i/s
#   Surrealist: instance through Surrealist::Serializer:    18691.4 i/s - same-ish: difference falls within error
#   AMS: instance:     2847.9 i/s - 7.75x  slower
#
# -- Collection --
# Comparison:
#   Surrealist: collection through Surrealist.surrealize_collection():        8.3 i/s
#   Surrealist: collection through Surrealist::Serializer:        7.5 i/s - same-ish: difference falls within error
#   AMS: collection:        5.9 i/s - 1.41x  slower
#
# --- Without AMS logging (which is turned on by default) ---
#
# -- Instance --
# Comparison:
#   Surrealist: instance through .surrealize:    21317.8 i/s
#   Surrealist: instance through Surrealist::Serializer:    18273.7 i/s - same-ish: difference falls within error
#   AMS(without logging): instance:     4108.7 i/s - 4.96x  slower
#
# -- Collection --
# Comparison:
#   Surrealist: collection through Surrealist.surrealize_collection():        8.5 i/s
#   Surrealist: collection through Surrealist::Serializer:        7.4 i/s - same-ish: difference falls within error
#   AMS(without logging): collection:        6.2 i/s - 1.37x  slower
#
# --- Associations ---
#
# -- Instance --
# Comparison:
#   Surrealist (associations): instance through .surrealize:     3093.0 i/s
#   Surrealist (associations): instance through Surrealist::Serializer:     3064.6 i/s - same-ish: difference falls within error
#   AMS (associations): instance:     1580.8 i/s - 2.04x  slower
#
# -- Collection --
# Comparison:
#   Surrealist (associations): collection through Surrealist.surrealize_collection():        2.0 i/s
#   Surrealist (associations): collection through Surrealist::Serializer:        2.0 i/s - 1.02x  slower
#   AMS (associations): collection:        1.3 i/s - 1.46x  slower

@nesaulov
Copy link
Owner Author

nesaulov commented Feb 3, 2018

@AlessandroMinali do you have ideas or suggestions what can be improved performance-wise or in general before the release?

@nesaulov
Copy link
Owner Author

nesaulov commented Feb 3, 2018

Actually, I have done some profiling right now, and it seems that the most expensive operation in the whole gem was String#match :)

Measure Mode: wall_time
Thread ID: 70115777572540
Fiber ID: 70115787074260
Total: 21.248953
Sort by: self_time

 %self      total      self      wait     child     calls  name
  6.08      1.713     1.291     0.000     0.423   403940   String#match
  3.90      8.274     0.829     0.000     7.446   364374  *Hash#each
  3.10      3.088     0.658     0.000     2.430   403940   <Module::Surrealist::TypeHelper>#dry_type?

This is stupid, so I am going to fix that part of TypeHelper

@nesaulov
Copy link
Owner Author

nesaulov commented Feb 3, 2018

More progress:

# ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]
# -- Instance --
# Comparison:
#   Surrealist: instance through .surrealize:    28945.6 i/s
#   Surrealist: instance through Surrealist::Serializer:    22889.2 i/s - same-ish: difference falls within error
#   AMS: instance:     1684.5 i/s - 17.18x  slower
#
# -- Collection --
# Comparison:
#   Surrealist: collection through Surrealist.surrealize_collection():       15.0 i/s
#   Surrealist: collection through Surrealist::Serializer:       12.8 i/s - 1.17x  slower
#   AMS: collection:        6.1 i/s - 2.44x  slower
#
# --- Without AMS logging (which is turned on by default) ---
#
# -- Instance --
# Comparison:
#   Surrealist: instance through .surrealize:    36503.6 i/s
#   Surrealist: instance through Surrealist::Serializer:    27772.8 i/s - 1.31x  slower
#   AMS(without logging): instance:     4751.2 i/s - 7.68x  slower
#
# -- Collection --
# Comparison:
#   Surrealist: collection through Surrealist.surrealize_collection():       15.2 i/s
#   Surrealist: collection through Surrealist::Serializer:       12.0 i/s - 1.27x  slower
#   AMS(without logging): collection:        6.1 i/s - 2.50x  slower
#
# --- Associations ---
#
# -- Instance --
# Comparison:
#   Surrealist (associations): instance through Surrealist::Serializer:     4122.8 i/s
#   Surrealist (associations): instance through .surrealize:     4056.9 i/s - same-ish: difference falls within error
#   AMS (associations): instance:     1721.8 i/s - 2.39x  slower
#
# -- Collection --
# Comparison:
#   Surrealist (associations): collection through Surrealist.surrealize_collection():        2.0 i/s
#   Surrealist (associations): collection through Surrealist::Serializer:        2.0 i/s - 1.02x  slower
#   AMS (associations): collection:        1.3 i/s - 1.52x  slower

@nesaulov nesaulov merged commit a96ea50 into master Feb 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants