How to reduce require time #14
-
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
I think you're comparing apples to oranges. Most of the examples are from bundled/standard gems; if you know how If you want to make a fair comparison, you should put it against other http clients. and repeat your example a few times to take caches into account. And you'll see that, while there's substantial room for improvement in |
Beta Was this translation helpful? Give feedback.
-
Lazy loading is a good idea. The library shouldn't really need to do anything until you actually use it. You may close the issue unless you want it as a reminder for future improvements. |
Beta Was this translation helpful? Give feedback.
I think you're comparing apples to oranges. Most of the examples are from bundled/standard gems; if you know how
require
works, it should be obvious why they're so fast. Also, a lot of gems are known for lazy loading code (andnokogiri
is mostly a C extension, not a lot of ruby code to read/parse/evaluate).If you want to make a fair comparison, you should put it against other http clients. and repeat your example a few times to take caches into account. And you'll see that, while there's substantial room for improvement in
httpx
, it's not that critical.