René's URL Explorer Experiment


Title: `import "typescript"` slower than `require("typescript")` due to `cjs-module-lexer` overhead · Issue #59913 · nodejs/node · GitHub

Open Graph Title: `import "typescript"` slower than `require("typescript")` due to `cjs-module-lexer` overhead · Issue #59913 · nodejs/node

X Title: `import "typescript"` slower than `require("typescript")` due to `cjs-module-lexer` overhead · Issue #59913 · nodejs/node

Description: Version Node.js v24.8.0 Node.js v22.18.0 Platform Observed on macOS (x64), but likely reproducible on other platforms. Description When loading typescript, using import is ~100ms slower than require. This seems to come from the cjs-modul...

Open Graph Description: Version Node.js v24.8.0 Node.js v22.18.0 Platform Observed on macOS (x64), but likely reproducible on other platforms. Description When loading typescript, using import is ~100ms slower than requir...

X Description: Version Node.js v24.8.0 Node.js v22.18.0 Platform Observed on macOS (x64), but likely reproducible on other platforms. Description When loading typescript, using import is ~100ms slower than requir...

Opengraph URL: https://github.com/nodejs/node/issues/59913

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`import \"typescript\"` slower than `require(\"typescript\")` due to `cjs-module-lexer` overhead","articleBody":"### Version\n\n- Node.js v24.8.0\n- Node.js v22.18.0\n\n### Platform\n\nObserved on macOS (x64), but likely reproducible on other platforms.\n\n### Description\n\nWhen loading `typescript`, using `import` is ~100ms slower than `require`.\n\nThis seems to come from the `cjs-module-lexer` step Node.js runs for CommonJS packages. Since `typescript` itself is CommonJS, `require` avoids the overhead and is noticeably faster.\n\n\u003cimg width=\"2368\" height=\"1322\" alt=\"Image\" src=\"https://github.com/user-attachments/assets/d0ec96bb-4b96-4222-843e-e45bd9138f96\" /\u003e\n\n### Reproduction\n\n\u003e https://github.com/chenjiahan/nodejs-repro-require-import-typescript\n\n```js\n// import.mjs\nimport typescript from \"typescript\";\n\nconsole.log(typescript);\n\n// require.cjs\nconst typescript = require(\"typescript\");\n\nconsole.log(typescript);\n```\n\n**Example results (macOS, Node.js v24.8.0):**\n\n```bash\n# ~200ms\ntime node ./import.mjs\n\n# ~100ms\ntime node ./require.cjs\n```\n\n### Ref\n\n* https://x.com/matteocollina/status/1968303799271047230 @mcollina \n","author":{"url":"https://github.com/chenjiahan","@type":"Person","name":"chenjiahan"},"datePublished":"2025-09-17T13:45:47.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/59913/node/issues/59913"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:9abeabbe-9fae-d7fb-eaa3-2a80311174e2
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idA1AE:1DA4B8:18163CA:2170FC5:6A4C1006
html-safe-nonce15c028327dd329bdb65938874bd19fc1b0fc8fb3f5ca7fbbe8e64ae6102f5a32
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMUFFOjFEQTRCODoxODE2M0NBOjIxNzBGQzU6NkE0QzEwMDYiLCJ2aXNpdG9yX2lkIjoiODc5MDIzMzMyNzA5NDk5MjkwMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac28005a75a12ca0929197c353bf059a3df91d3dedf8dc8423e84240a704929693
hovercard-subject-tagissue:3426390504
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/59913/issue_layout
twitter:imagehttps://opengraph.githubassets.com/e29206cbcca9743d309097caf51a332ba2d07ee7b096f38989cc9babc66285c6/nodejs/node/issues/59913
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/e29206cbcca9743d309097caf51a332ba2d07ee7b096f38989cc9babc66285c6/nodejs/node/issues/59913
og:image:altVersion Node.js v24.8.0 Node.js v22.18.0 Platform Observed on macOS (x64), but likely reproducible on other platforms. Description When loading typescript, using import is ~100ms slower than requir...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamechenjiahan
hostnamegithub.com
expected-hostnamegithub.com
None0ccfc9e5281bfe12e38a4d632dc422843e4d5b6757917f7efda2f6567d72fea9
turbo-cache-controlno-preview
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
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release18812876666a23a0912556e224383baa4c84cf8e
ui-targetcanary-2
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/nodejs/node/issues/59913#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F59913
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%2Fissues%2F59913
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%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/issues/59913
Reloadhttps://github.com/nodejs/node/issues/59913
Reloadhttps://github.com/nodejs/node/issues/59913
Please reload this pagehttps://github.com/nodejs/node/issues/59913
nodejs https://github.com/nodejs
nodehttps://github.com/nodejs/node
Please reload this pagehttps://github.com/nodejs/node/issues/59913
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 967 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
import "typescript" slower than require("typescript") due to cjs-module-lexer overheadhttps://github.com/nodejs/node/issues/59913#top
https://github.com/chenjiahan
chenjiahanhttps://github.com/chenjiahan
on Sep 17, 2025https://github.com/nodejs/node/issues/59913#issue-3426390504
https://private-user-images.githubusercontent.com/7237365/490576852-d0ec96bb-4b96-4222-843e-e45bd9138f96.png?jwt=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3ODMzNzAwMzQsIm5iZiI6MTc4MzM2OTczNCwicGF0aCI6Ii83MjM3MzY1LzQ5MDU3Njg1Mi1kMGVjOTZiYi00Yjk2LTQyMjItODQzZS1lNDViZDkxMzhmOTYucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI2MDcwNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNjA3MDZUMjAyODU0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9ZDA3ZmYzMzk2YjgwMzU3YzcxYWJhOGEyMTE0OTQ4Y2Y5MWZlODZhNDA5YjNjZGEwMTY1ODUwMTg2MzI4MjY4MiZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmcmVzcG9uc2UtY29udGVudC10eXBlPWltYWdlJTJGcG5nIn0.Zjo8G4Hlu8VpYs0zI933wgcX7GoWef9-pfddvvU2QE4
https://github.com/chenjiahan/nodejs-repro-require-import-typescripthttps://github.com/chenjiahan/nodejs-repro-require-import-typescript
https://x.com/matteocollina/status/1968303799271047230https://x.com/matteocollina/status/1968303799271047230
@mcollinahttps://github.com/mcollina
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.