Comments (3)
Just to confirm, those are the same Plug versions, correct?
from plug.
And can you please provide the benchmarking code?
from plug.
@josevalim
Yes, the benchmark is on the same version
"plug": {:hex, :plug, "1.16.0", "1d07d50cb9bb05097fdf187b31cf087c7297aafc3fed8299aac79c128a707e47", [:mix], [{:mime, "~> 1.0 or ~> 2.0", [hex: :mime, repo: "hexpm", optional: false]}, {:plug_crypto, "~> 1.1.1 or ~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.3 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "cbf53aa1f5c4d758a7559c0bd6d59e286c2be0c6a1fac8cc3eee2f638243b93e"},
The benchmark code (slightly modified but still shows 4x diff) is
defmodule Benchmark.CookieDecode do
def run(_) do
cookie =
"a=1; b=111; b_exp=1738257503023; c=july2023; b=fsasfd1d46277134810r0.11893443256905789; d=b9d4ad1d-94dc-7fd6-ae1d-305e63791ac6; e=[%22somestuff%22]; fff={%22volume%22:0.7}; anotherstuff=hh; aaa3=hh; bbb={}; uii=somemorerandomstuf; hhhh=morestuff; kkk=eyJhYiI6Im8xOCIsInBhIjoiQ003IiwiZXAiOnRydWUsImV6IjpmYWxzZSwicGwiOmZhbHNlLCJwcyI6IjE0V2VDNElVaTRJaU9hSlp2NnpfM0tSMTJDMjE0NUU3UVN4SjZ4RHJRNG8iLCJjbCI6ZmFsc2UsImNjIjoiZ2IiLCJyZWFsbSI6Ii8iLCJzZXMtZXhwIjoxNzEyMDYzNzkwMDAwLCJqd3QtZXhwIjoxNzc1MTM0ODkwMDAwLCJydGtuLWV4cCI6MTc3NTEzNDg5MDAwMCwidGtuLWV4cCI6MTcxODgxNzMwMjAwMCwicG4iOjM5fQ; _chartbeat2=.1706277135627.1718810705253.0000001011000111.Cbuhe6BNM-tUCX5KjaCce88iBsBqeL.2; _cccc=Bfhgdfgd_dfsafsKKK; some_nonve=D9Uze6r1L5Cb9iZE8BXHXfMU; some_token=eyJh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_440sF_734II0EyaWnOCI-nmM-AbQ41JPfl8gnv6Ow; kkktkn=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c; idid=Elixir%20is%20a%20dynamic%2C%20functional%20language%20designed%20for%20building%20scalable%20and%20maintainable%20applications.%20It%20leverages%20the%20Erlang%20VM%2C%20known%20for%20running%20low-latency%2C%20distributed%2C%20and%20fault-tolerant%20systems; _aaaa=random; TTT_fdsdfd=1; HHH_fdsfds=1"
Benchee.run(
%{
"Plug.Conn.Cookies.decode/1" => fn ->
Plug.Conn.Cookies.decode(cookie)
end
},
time: 5,
memory_time: 2
)
end
end
from plug.
Related Issues (20)
- Mismatch spec for `Plug.Conn.Query.decode` HOT 1
- Plug.RequestId: put the `request_id` in `:private` or `:assigns`? HOT 1
- 1.15 changes decoding behaviour of `[]` HOT 5
- Request: Support MFA tuple for Plug.Session opts HOT 4
- Plug.Upload's random-tempdir generation is not very random HOT 1
- `strip_spaces` fails on `nil` since 1.15.0 HOT 1
- Plug.Conn.Query has changed the way it decodes parameters from 1.14 to 1.15 without warning HOT 1
- More flexible dynamic routes with `:` parameters HOT 2
- Compatibility issue with plug_crypto 2.0.0 HOT 3
- Error: There isn't enough space to open the popup HOT 1
- Docs inconsistency between Plug moduledoc and Plug.run HOT 1
- Plug.Upload: demonitor previous owner when giving away HOT 1
- Compilation issues on Erlang 26.x HOT 3
- html array items are dropped. HOT 1
- Plug.Conn is not closed when user closes the browser's tab (SSE) HOT 2
- setting max_age to nil in put_resp_cookie/4 causes crash HOT 1
- Sending a zip created on-the-fly via Plug.Conn.chunk fails after around 200Mb HOT 8
- Plug.Router macros and functional plugs HOT 1
- Wrong editor links when running inside a container HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from plug.