-
-
Notifications
You must be signed in to change notification settings - Fork 631
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
Performance decrease after 6.9 due to JSON.parse of already json string #819
Comments
justin808
referenced
this issue
Apr 24, 2017
…erformance Initial implementation started by https://github.com/eliaslopezgt and then https://github.com/squadette * Refactor console output to use <script> tag with a certain ID * Use <script type="application/json"> with JSON content instead of attribute * Pretty-print JSON in development and testing * getAttribute() is better, because it handles attributes which are not present. * Return skip display none to react on rails configuration * Extract data-js-react-on-rails-store attribute to the const * Return to_json method call to app_props_server_render to ensure handling the both cases * Delete unnecessary style method and HIDDEN constant from react component module * Improve jsonEl parsing to handle props as already converted from JSON to a string * Move handling props already converted to json string to ruby code * Escape json from props as json string * Add test to ensure that even json string props are sanitezed * Delete test json props because we parse all props to a hash now
Reverting the line here: |
Fixed by #821 and shipped in 7.0.0. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is some performance decrease for RoR versions after 6.9 which looks like this (from our internal server-side benchmarks):
The reason for it is JSON.parsing of the already json string to hash (and later back), which should be generally just a copy-paste operation
https://github.com/shakacode/react_on_rails/blob/master/lib/react_on_rails/react_component/options.rb#L17
The text was updated successfully, but these errors were encountered: