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

Using the Inflector comes with a big performance hit #37

Open
ahx opened this issue Apr 9, 2019 · 1 comment
Open

Using the Inflector comes with a big performance hit #37

ahx opened this issue Apr 9, 2019 · 1 comment

Comments

@ahx
Copy link
Contributor

ahx commented Apr 9, 2019

I noticed a significant performance increase when not using Inflector#decode_type (no matter if I use dry-inflector (#36) or Inflecto)
In other words: Using the inflector seems to come with a pretty big cost.

🤔

I can provide a performance test if you are interested.

@ahx ahx changed the title Performance boost by disabling Inflector decode_type is Performance boost by disabling Inflector#decode_type Apr 9, 2019
@ahx ahx changed the title Performance boost by disabling Inflector#decode_type Using the Inflector comes with a big performance hit Apr 9, 2019
@doughsay
Copy link
Collaborator

I'm curious what you might be doing that causes the performance of inflecting to overshadow the latency of actually performing http requests to a server. It seems to me that any inflecting algorithm, even a slow one, wouldn't compare at all to the latency and performance of contacting external servers. So I'm basically wondering why it matters that it might be a bit slow?

On the other hand: if we really wanted to remove the inflector altogether, it would be harder to follow the resource naming conventions that jsonapi recommends. That may or may not be a deal-breaker for this library, I'd have to do some more research on how I'm using it to see how it would affect things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants