Skip to content

Commit 11e237f

Browse files
authored
Use native llhttp gem on MRI (#800)
All other rubies continue to use `llhttp-ffi`
1 parent 1af3c8e commit 11e237f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
### Changed
11+
12+
- Use native llhttp gem for MRI Ruby and llhttp-ffi for other interpreters for better performance
13+
1014
### Removed
1115

1216
- **BREAKING** Drop Ruby 2.x support

http.gemspec

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,13 @@ Gem::Specification.new do |gem|
3030
gem.add_runtime_dependency "addressable", "~> 2.8"
3131
gem.add_runtime_dependency "http-cookie", "~> 1.0"
3232
gem.add_runtime_dependency "http-form_data", "~> 2.2"
33-
gem.add_runtime_dependency "llhttp-ffi", "~> 0.5.0"
33+
34+
# Use native llhttp for MRI (more performant) and llhttp-ffi for other interpreters (better compatibility)
35+
if RUBY_ENGINE == "ruby"
36+
gem.add_runtime_dependency "llhttp", "~> 0.5.0"
37+
else
38+
gem.add_runtime_dependency "llhttp-ffi", "~> 0.5.0"
39+
end
3440

3541
gem.metadata = {
3642
"source_code_uri" => "https://github.com/httprb/http",

0 commit comments

Comments
 (0)