René's URL Explorer Experiment


Title: lib: use fastbuffer for empty buffer allocation by gurgunday · Pull Request #60558 · nodejs/node · GitHub

Open Graph Title: lib: use fastbuffer for empty buffer allocation by gurgunday · Pull Request #60558 · nodejs/node

X Title: lib: use fastbuffer for empty buffer allocation by gurgunday · Pull Request #60558 · nodejs/node

Description: As in other places, we don't need to call Buffer.alloc(0), which validates the length and calls FastBuffer anyway, when we're creating an empty Buffer This bypasses the validation logic and is consequently faster buffers/fast-buffer.js buffers/fast-buffer.js operation="fastbuffer" n=1000000: 47,834,970.118450865 buffers/fast-buffer.js operation="bufferalloc" n=1000000: 33,173,868.757805813 'use strict'; // flags: --expose-internals const common = require('../common'); const { FastBuffer } = require('internal/buffer'); const bench = common.createBenchmark(main, { n: [1e6], operation: ['fastbuffer', 'bufferalloc'], }); function main({ n, operation }) { switch (operation) { case 'fastbuffer': bench.start(); for (let i = 0; i < n; i++) { new FastBuffer() } bench.end(n); break; case 'bufferalloc': bench.start(); for (let i = 0; i < n; i++) { Buffer.alloc(0) } bench.end(n); break; } }

Open Graph Description: As in other places, we don't need to call Buffer.alloc(0), which validates the length and calls FastBuffer anyway, when we're creating an empty Buffer This bypasses the validation logic and...

X Description: As in other places, we don&#39;t need to call Buffer.alloc(0), which validates the length and calls FastBuffer anyway, when we&#39;re creating an empty Buffer This bypasses the validation l...

Opengraph URL: https://github.com/nodejs/node/pull/60558

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:fa82978a-70ea-d7b6-3fc8-af5b3640513e
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id98EA:127DAD:B92E83:F7375A:6A4C531F
html-safe-nonce59ccf787939f9f00927261bc4fd7545cd027d9c822501587672f7006c402f42b
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5OEVBOjEyN0RBRDpCOTJFODM6RjczNzVBOjZBNEM1MzFGIiwidmlzaXRvcl9pZCI6IjIxNjkxNzI1NDc0MzM0MTk1NTEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacb784ac720dca0cf15ed28e2d01c6b7cb6e2335e9d8f17be8fbc71e3c18892e77
hovercard-subject-tagpull_request:2970987823
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/nodejs/node/pull/60558/files
twitter:imagehttps://avatars.githubusercontent.com/u/74139498?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/74139498?s=400&v=4
og:image:altAs in other places, we don't need to call Buffer.alloc(0), which validates the length and calls FastBuffer anyway, when we're creating an empty Buffer This bypasses the validation logic and...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release14099438da5379150f15a2892474c7c7e6c0e55e
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodejs/node/pull/60558/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F60558%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fpull%2F60558%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/pull/60558/files
Reloadhttps://github.com/nodejs/node/pull/60558/files
Reloadhttps://github.com/nodejs/node/pull/60558/files
Please reload this pagehttps://github.com/nodejs/node/pull/60558/files
nodejs https://github.com/nodejs
nodehttps://github.com/nodejs/node
Please reload this pagehttps://github.com/nodejs/node/pull/60558/files
Notifications https://github.com/login?return_to=%2Fnodejs%2Fnode
Fork 36k https://github.com/login?return_to=%2Fnodejs%2Fnode
Star 118k https://github.com/login?return_to=%2Fnodejs%2Fnode
Code https://github.com/nodejs/node
Issues 1.4k https://github.com/nodejs/node/issues
Pull requests 964 https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects https://github.com/nodejs/node/projects
Security and quality 0 https://github.com/nodejs/node/security
Insights https://github.com/nodejs/node/pulse
Code https://github.com/nodejs/node
Issues https://github.com/nodejs/node/issues
Pull requests https://github.com/nodejs/node/pulls
Actions https://github.com/nodejs/node/actions
Projects https://github.com/nodejs/node/projects
Security and quality https://github.com/nodejs/node/security
Insights https://github.com/nodejs/node/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fnodejs%2Fnode%2Fissues%2Fnew%2Fchoose
aduh95https://github.com/aduh95
nodejs:mainhttps://github.com/nodejs/node/tree/main
gurgunday:fastbufferhttps://github.com/gurgunday/node/tree/fastbuffer
Conversation 15 https://github.com/nodejs/node/pull/60558
Commits 3 https://github.com/nodejs/node/pull/60558/commits
Checks 26 https://github.com/nodejs/node/pull/60558/checks
Files changed https://github.com/nodejs/node/pull/60558/files
Please reload this pagehttps://github.com/nodejs/node/pull/60558/files
lib: use fastbuffer for empty buffer allocation https://github.com/nodejs/node/pull/60558/files#top
Show all changes 3 commits https://github.com/nodejs/node/pull/60558/files
3cf7088 lib: use fastbuffer for empty buffer allocation gurgunday Nov 2, 2025 https://github.com/nodejs/node/pull/60558/commits/3cf70881d715694bfc971a13d4e7e7c15dfcf859
aa2fca1 add benchmark gurgunday Nov 15, 2025 https://github.com/nodejs/node/pull/60558/commits/aa2fca1892046a3d8dc1b5522419ba37a371ed65
10bb3e6 Revert "add benchmark" gurgunday Nov 15, 2025 https://github.com/nodejs/node/pull/60558/commits/10bb3e64cacb3cf6bff55fa2dfaecd6cc30992d2
Clear filters https://github.com/nodejs/node/pull/60558/files
Please reload this pagehttps://github.com/nodejs/node/pull/60558/files
Please reload this pagehttps://github.com/nodejs/node/pull/60558/files
buffer.js https://github.com/nodejs/node/pull/60558/files#diff-3c2cd5c512dd026a7765b6b2ae3f85785d3b7ea3795e11949892b7b73beee630
dgram.js https://github.com/nodejs/node/pull/60558/files#diff-398ce2304fa631b6d4a8bc90effa5e088bae7d3b08a5af51bcb10531f5b35e75
inspect_client.js https://github.com/nodejs/node/pull/60558/files#diff-5efa15493d539766a34ded746837bb9688ee756c6db8d3d065be20186dab443d
readable.js https://github.com/nodejs/node/pull/60558/files#diff-040c1f5a53844e600d40b33c4624f1fe39fcf2f8d62c76ca3fc5ea5442231469
runner.js https://github.com/nodejs/node/pull/60558/files#diff-840cee72cdda14be90e6c5607ffa844eaf73be966607ddc834cc667bd142fb21
zlib.js https://github.com/nodejs/node/pull/60558/files#diff-2386e2eaad6fb3c2f1de21d9594a6411b12910fc17e4b4f12d37e87ab3f547a4
lib/buffer.jshttps://github.com/nodejs/node/pull/60558/files#diff-3c2cd5c512dd026a7765b6b2ae3f85785d3b7ea3795e11949892b7b73beee630
View file https://github.com/gurgunday/node/blob/10bb3e64cacb3cf6bff55fa2dfaecd6cc30992d2/lib/buffer.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/60558/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/60558/files#diff-3c2cd5c512dd026a7765b6b2ae3f85785d3b7ea3795e11949892b7b73beee630
https://github.com/nodejs/node/pull/60558/files#diff-3c2cd5c512dd026a7765b6b2ae3f85785d3b7ea3795e11949892b7b73beee630
https://github.com/nodejs/node/pull/60558/files#diff-3c2cd5c512dd026a7765b6b2ae3f85785d3b7ea3795e11949892b7b73beee630
https://github.com/nodejs/node/pull/60558/files#diff-3c2cd5c512dd026a7765b6b2ae3f85785d3b7ea3795e11949892b7b73beee630
lib/dgram.jshttps://github.com/nodejs/node/pull/60558/files#diff-398ce2304fa631b6d4a8bc90effa5e088bae7d3b08a5af51bcb10531f5b35e75
View file https://github.com/gurgunday/node/blob/10bb3e64cacb3cf6bff55fa2dfaecd6cc30992d2/lib/dgram.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/60558/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/60558/files#diff-398ce2304fa631b6d4a8bc90effa5e088bae7d3b08a5af51bcb10531f5b35e75
https://github.com/nodejs/node/pull/60558/files#diff-398ce2304fa631b6d4a8bc90effa5e088bae7d3b08a5af51bcb10531f5b35e75
https://github.com/nodejs/node/pull/60558/files#diff-398ce2304fa631b6d4a8bc90effa5e088bae7d3b08a5af51bcb10531f5b35e75
https://github.com/nodejs/node/pull/60558/files#diff-398ce2304fa631b6d4a8bc90effa5e088bae7d3b08a5af51bcb10531f5b35e75
lib/internal/debugger/inspect_client.jshttps://github.com/nodejs/node/pull/60558/files#diff-5efa15493d539766a34ded746837bb9688ee756c6db8d3d065be20186dab443d
View file https://github.com/gurgunday/node/blob/10bb3e64cacb3cf6bff55fa2dfaecd6cc30992d2/lib/internal/debugger/inspect_client.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/60558/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/60558/files#diff-5efa15493d539766a34ded746837bb9688ee756c6db8d3d065be20186dab443d
https://github.com/nodejs/node/pull/60558/files#diff-5efa15493d539766a34ded746837bb9688ee756c6db8d3d065be20186dab443d
https://github.com/nodejs/node/pull/60558/files#diff-5efa15493d539766a34ded746837bb9688ee756c6db8d3d065be20186dab443d
https://github.com/nodejs/node/pull/60558/files#diff-5efa15493d539766a34ded746837bb9688ee756c6db8d3d065be20186dab443d
https://github.com/nodejs/node/pull/60558/files#diff-5efa15493d539766a34ded746837bb9688ee756c6db8d3d065be20186dab443d
https://github.com/nodejs/node/pull/60558/files#diff-5efa15493d539766a34ded746837bb9688ee756c6db8d3d065be20186dab443d
lib/internal/streams/readable.jshttps://github.com/nodejs/node/pull/60558/files#diff-040c1f5a53844e600d40b33c4624f1fe39fcf2f8d62c76ca3fc5ea5442231469
View file https://github.com/gurgunday/node/blob/10bb3e64cacb3cf6bff55fa2dfaecd6cc30992d2/lib/internal/streams/readable.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/60558/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/60558/files#diff-040c1f5a53844e600d40b33c4624f1fe39fcf2f8d62c76ca3fc5ea5442231469
https://github.com/nodejs/node/pull/60558/files#diff-040c1f5a53844e600d40b33c4624f1fe39fcf2f8d62c76ca3fc5ea5442231469
lib/internal/test_runner/runner.jshttps://github.com/nodejs/node/pull/60558/files#diff-840cee72cdda14be90e6c5607ffa844eaf73be966607ddc834cc667bd142fb21
View file https://github.com/gurgunday/node/blob/10bb3e64cacb3cf6bff55fa2dfaecd6cc30992d2/lib/internal/test_runner/runner.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/60558/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/60558/files#diff-840cee72cdda14be90e6c5607ffa844eaf73be966607ddc834cc667bd142fb21
https://github.com/nodejs/node/pull/60558/files#diff-840cee72cdda14be90e6c5607ffa844eaf73be966607ddc834cc667bd142fb21
https://github.com/nodejs/node/pull/60558/files#diff-840cee72cdda14be90e6c5607ffa844eaf73be966607ddc834cc667bd142fb21
https://github.com/nodejs/node/pull/60558/files#diff-840cee72cdda14be90e6c5607ffa844eaf73be966607ddc834cc667bd142fb21
lib/zlib.jshttps://github.com/nodejs/node/pull/60558/files#diff-2386e2eaad6fb3c2f1de21d9594a6411b12910fc17e4b4f12d37e87ab3f547a4
View file https://github.com/gurgunday/node/blob/10bb3e64cacb3cf6bff55fa2dfaecd6cc30992d2/lib/zlib.js
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/nodejs/node/pull/60558/{{ revealButtonHref }}
https://github.com/nodejs/node/pull/60558/files#diff-2386e2eaad6fb3c2f1de21d9594a6411b12910fc17e4b4f12d37e87ab3f547a4
https://github.com/nodejs/node/pull/60558/files#diff-2386e2eaad6fb3c2f1de21d9594a6411b12910fc17e4b4f12d37e87ab3f547a4
https://github.com/nodejs/node/pull/60558/files#diff-2386e2eaad6fb3c2f1de21d9594a6411b12910fc17e4b4f12d37e87ab3f547a4
https://github.com/nodejs/node/pull/60558/files#diff-2386e2eaad6fb3c2f1de21d9594a6411b12910fc17e4b4f12d37e87ab3f547a4
https://github.com/nodejs/node/pull/60558/files#diff-2386e2eaad6fb3c2f1de21d9594a6411b12910fc17e4b4f12d37e87ab3f547a4
https://github.com/nodejs/node/pull/60558/files#diff-2386e2eaad6fb3c2f1de21d9594a6411b12910fc17e4b4f12d37e87ab3f547a4
https://github.com/nodejs/node/pull/60558/files#diff-2386e2eaad6fb3c2f1de21d9594a6411b12910fc17e4b4f12d37e87ab3f547a4
https://github.com/nodejs/node/pull/60558/files#diff-2386e2eaad6fb3c2f1de21d9594a6411b12910fc17e4b4f12d37e87ab3f547a4
Please reload this pagehttps://github.com/nodejs/node/pull/60558/files
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.