Performance issue

Created on 13 July 2023, over 1 year ago
Updated 28 March 2024, about 1 year ago

Problem/Motivation

The module removes links fine but does it on the onResponse event.
The problem is that Drupal spend resources on the link creation process, and after that, we spend additional time decoding response and removing links.
It is a bit of strange logic from the resource usage side and looks like it should be somehow changed.

Proposed resolution

I checked how JSON:API works and currently see only one way to fix it - override part of classes that handle links.
This solution isn't well because the module too much depend to inner changes in the JSON:API module in this case, but we can win some time on the response generation.
So I don't know if this solution will be as stable with different JSON:API module versions as the module is now, but time on response generation decreases for sure

πŸ“Œ Task
Status

Fixed

Version

2.0

Component

Code

Created by

πŸ‡ΊπŸ‡¦Ukraine _tarik_ Lutsk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @_tarik_
  • @_tarik_ opened merge request.
  • Status changed to Needs review over 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine _tarik_ Lutsk

    Summary of the provided changes:

    • Overided several services from JSON:API
    • Removed event subscriber
    • Updated configuration form
    • Added hook update to update module configuration

    As I mentioned in the issue description these changes too much depend to inner structure of JSON:API.

    This is the start of work on this issue and I will be glad if someone can help to find a better way to handle this problem

  • πŸ‡©πŸ‡ͺGermany ro-no-lo

    Hi,

    thanks for your feedback. I do know that this solution is not optimal. As written in the project description, it was developed with the suggestion of one of the JSON:API core maintainers in mind. Feel free to find a better way.

  • πŸ‡©πŸ‡ͺGermany ro-no-lo

    Oh I see that you already did the work, but to be honest I am not *fit* enough to check if your solution will work in all circumstances. I hope the community can help here.

  • πŸ‡ΊπŸ‡¦Ukraine _tarik_ Lutsk

    I have rechecked my code here, so probably the best place for all these changes is the 2.x version of the module. The code from this merge request makes module logic too different to use in 1.x version.
    I will create a new development branch and put an updated code version there.

    • _tarik_ β†’ committed b75729f9 on 2.x
      Issue #3374517: Overrided jsonapi services and controller, removed event...
  • Status changed to Fixed about 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine _tarik_ Lutsk

    The fixes from this issue were merged into the new 2.x dev version of the module

  • Status changed to Fixed about 1 year ago
  • πŸ‡ΊπŸ‡¦Ukraine _tarik_ Lutsk
Production build 0.71.5 2024