MIMEType Performance
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 399
- Forks
- 11
- Avg merge
- 29m
- Merged PRs (30d)
- 1
Description
I know that MIMEType is recently added and under Experimental flag. But I want to draw a attention on it's performance.
It is not the slowest compare to the userland module, but it can do better.
util#MIMEType x 1,206,781 ops/sec ±0.22% (96 runs sampled)
fast-content-type-parse#parse x 3,752,236 ops/sec ±0.42% (96 runs sampled)
fast-content-type-parse#safeParse x 3,675,645 ops/sec ±1.09% (94 runs sampled)
content-type#parse x 1,452,582 ops/sec ±0.37% (95 runs sampled)
busboy#parseContentType x 924,306 ops/sec ±0.43% (94 runs sampled)
Fastest is fast-content-type-parse#parse
I am considering replacing MIMEType for the Content-Type parsing in fastify but the performance is the main drawback.
The main reason behind using MIMEType is the .essence property did a great job in unifying the Browser and Server in terms of Content-Type guessing / matching and prevent the similar security issue like https://github.com/fastify/fastify/security/advisories/GHSA-3fjj-p79j-c9hh
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the MIMEType benchmark described in the issue and compare it with fast-content-type-parse, content-type, and busboy. Investigate the existing MIMEType implementation and benchmark results; done means identifying and validating a performance improvement without losing the essence behavior or the Content-Type security properties referenced here.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- node.js
- Domain
- performance
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100