// This snippet mostly exists to reproduce a memory leak // import { bench, run } from "mitata"; const obj = { "id": 1296269, "node_id": "MDEwOlJlcG9zaXRvcnkxMjk2MjY5", "name": "Hello-World", "full_name": "octocat/Hello-World", "owner": { "login": "octocat", "id": 1, "node_id": "MDQ6VXNlcjE=", "avatar_url": "https://github.com/images/error/octocat_happy.gif", "gravatar_id": "", "url": "https://api.github.com/users/octocat", "html_url": "https://github.com/octocat", "followers_url": "https://api.github.com/users/octocat/followers", "following_url": "https://api.github.com/users/octocat/following{/other_user}", "gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", "starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", "subscriptions_url": "https://api.github.com/users/octocat/subscriptions", "organizations_url": "https://api.github.com/users/octocat/orgs", "repos_url": "https://api.github.com/users/octocat/repos", "events_url": "https://api.github.com/users/octocat/events{/privacy}", "received_events_url": "https://api.github.com/users/octocat/received_events", "type": "User", "site_admin": false, }, "private": false, "html_url": "https://github.com/octocat/Hello-World", "description": "This your first repo!", "fork": false, "url": "https://api.github.com/repos/octocat/Hello-World", "archive_url": "https://api.github.com/repos/octocat/Hello-World/{archive_format}{/ref}", "assignees_url": "https://api.github.com/repos/octocat/Hello-World/assignees{/user}", "blobs_url": "https://api.github.com/repos/octocat/Hello-World/git/blobs{/sha}", "branches_url": "https://api.github.com/repos/octocat/Hello-World/branches{/branch}", "collaborators_url": "https://api.github.com/repos/octocat/Hello-World/collaborators{/collaborator}", "comments_url": "https://api.github.com/repos/octocat/Hello-World/comments{/number}", "commits_url": "https://api.github.com/repos/octocat/Hello-World/commits{/sha}", "compare_url": "https://api.github.com/repos/octocat/Hello-World/compare/{base}...{head}", "contents_url": "https://api.github.com/repos/octocat/Hello-World/contents/{+path}", "contributors_url": "https://api.github.com/repos/octocat/Hello-World/contributors", "deployments_url": "https://api.github.com/repos/octocat/Hello-World/deployments", "downloads_url": "https://api.github.com/repos/octocat/Hello-World/downloads", "events_url": "https://api.github.com/repos/octocat/Hello-World/events", "forks_url": "https://api.github.com/repos/octocat/Hello-World/forks", "git_commits_url": "https://api.github.com/repos/octocat/Hello-World/git/commits{/sha}", "git_refs_url": "https://api.github.com/repos/octocat/Hello-World/git/refs{/sha}", "git_tags_url": "https://api.github.com/repos/octocat/Hello-World/git/tags{/sha}", "git_url": "git:github.com/octocat/Hello-World.git", "issue_comment_url": "https://api.github.com/repos/octocat/Hello-World/issues/comments{/number}", "issue_events_url": "https://api.github.com/repos/octocat/Hello-World/issues/events{/number}", "issues_url": "https://api.github.com/repos/octocat/Hello-World/issues{/number}", "keys_url": "https://api.github.com/repos/octocat/Hello-World/keys{/key_id}", "labels_url": "https://api.github.com/repos/octocat/Hello-World/labels{/name}", "languages_url": "https://api.github.com/repos/octocat/Hello-World/languages", "merges_url": "https://api.github.com/repos/octocat/Hello-World/merges", "milestones_url": "https://api.github.com/repos/octocat/Hello-World/milestones{/number}", "notifications_url": "https://api.github.com/repos/octocat/Hello-World/notifications{?since,all,participating}", "pulls_url": "https://api.github.com/repos/octocat/Hello-World/pulls{/number}", "releases_url": "https://api.github.com/repos/octocat/Hello-World/releases{/id}", "ssh_url": "git@github.com:octocat/Hello-World.git", "stargazers_url": "https://api.github.com/repos/octocat/Hello-World/stargazers", "statuses_url": "https://api.github.com/repos/octocat/Hello-World/statuses/{sha}", "subscribers_url": "https://api.github.com/repos/octocat/Hello-World/subscribers", "subscription_url": "https://api.github.com/repos/octocat/Hello-World/subscription", "tags_url": "https://api.github.com/repos/octocat/Hello-World/tags", "teams_url": "https://api.github.com/repos/octocat/Hello-World/teams", "trees_url": "https://api.github.com/repos/octocat/Hello-World/git/trees{/sha}", "clone_url": "https://github.com/octocat/Hello-World.git", "mirror_url": "git:git.example.com/octocat/Hello-World", "hooks_url": "https://api.github.com/repos/octocat/Hello-World/hooks", "svn_url": "https://svn.github.com/octocat/Hello-World", "homepage": "https://github.com", "language": null, "forks_count": 9, "stargazers_count": 80, "watchers_count": 80, "size": 108, "default_branch": "master", "open_issues_count": 0, "is_template": false, "topics": ["octocat", "atom", "electron", "api"], "has_issues": true, "has_projects": true, "has_wiki": true, "has_pages": false, "has_downloads": true, "has_discussions": false, "archived": false, "disabled": false, "visibility": "public", "pushed_at": "2011-01-26T19:06:43Z", "created_at": "2011-01-26T19:01:12Z", "updated_at": "2011-01-26T19:14:43Z", "permissions": { "admin": false, "push": false, "pull": true, }, "security_and_analysis": { "advanced_security": { "status": "enabled", }, "secret_scanning": { "status": "enabled", }, "secret_scanning_push_protection": { "status": "disabled", }, }, }; // Force the string to be 8bit const str = String.fromCharCode( ...JSON.stringify(obj) .split("") .map(a => a.charCodeAt(0)), ); var i = 0; bench("new Response().arrayBuffer() (new string each call, latin1)", async () => { return await new Response(str + i++).arrayBuffer(); }); bench("new Response().arrayBuffer() (new string each call, utf16)", async () => { return await new Response(str + i++ + "😊").arrayBuffer(); }); bench("new Response().arrayBuffer() (existing string, latin1)", async () => { return await new Response(str).arrayBuffer(); }); await run(); ble Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets/baz.js (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-03-17[bun.js] Implement `import.meta.resolve`Gravatar Jarred Sumner 7-31/+198
2022-03-17[bun.js] Add some of the fs constantsGravatar Jarred Sumner 1-0/+8
2022-03-17Ensure we handle unicode correctly when returning strings for node fsGravatar Jarred Sumner 1-2/+7
2022-03-17[JS Transpiler] Always print escape unicode identifiers, for nowGravatar Jarred Sumner 1-6/+5
2022-03-17Update lockfile.zigGravatar Jarred Sumner 1-0/+16
2022-03-17Move `Bun` to JSC.APIGravatar Jarred Sumner 8-1420/+1667
2022-03-17lil helper methodGravatar Jarred Sumner 1-0/+8
2022-03-17Update build-idGravatar Jarred Sumner 1-1/+1
2022-03-17only check oncebun-v0.0.73Gravatar Jarred Sumner 1-42/+33
2022-03-17Add test coverage for emoji in blobsGravatar Jarred Sumner 1-84/+133
2022-03-17Prevent segfaultGravatar Jarred Sumner 1-0/+4
2022-03-17move some code aroundGravatar Jarred Sumner 3-189/+9
2022-03-17Update build-idGravatar Jarred Sumner 1-1/+1
2022-03-17optimize blob.text()Gravatar Jarred Sumner 1-83/+185
2022-03-17query_string_map -> urlGravatar Jarred Sumner 30-28/+405
2022-03-16Fix crash from checking if something is an object when it is undefinedbun-v0.0.72Gravatar Jarred Sumner 4-12/+12
2022-03-16Fix setTimeout on LinuxGravatar Jarred SUmner 1-5/+12
2022-03-16Increase from 4ms -> 40ms for timeoutGravatar Jarred SUmner 1-1/+1
2022-03-16Update README.mdGravatar Jarred Sumner 1-0/+1
2022-03-16llvm-stirp not workingGravatar Jarred Sumner 1-1/+0
2022-03-16Update MakefileGravatar Jarred Sumner 1-1/+1
2022-03-16Update Dockerfile.baseGravatar Jarred Sumner 1-0/+1
2022-03-16Update MakefileGravatar Jarred Sumner 1-2/+23
2022-03-16cleanup error printingGravatar Jarred Sumner 7-105/+193
2022-03-16Revert "Unlimited arguments in process.nextTick"Gravatar Jarred Sumner 1-38/+48
2022-03-16bun.lockbGravatar Jarred Sumner 3-0/+0
2022-03-16Update feature_flags.zigGravatar Jarred Sumner 1-0/+1
2022-03-16[bun.js] Bun.unsafe test should check the gcGravatar Jarred Sumner 1-4/+14
2022-03-16Update work_pool.zigGravatar Jarred Sumner 1-21/+28
2022-03-16Add a way to run serial tasks on a different threadGravatar Jarred Sumner 1-3/+65
2022-03-16fix crash when SyntaxError is thrown and we did not receive an ErrorInstance?Gravatar Jarred Sumner 1-18/+25
2022-03-16[bun.js] Fix release-mode test failures in HeadersGravatar Jarred Sumner 1-47/+42
2022-03-16Update ref_count.zigGravatar Jarred Sumner 1-2/+0
2022-03-15file is too bigjarred/replGravatar Jarred Sumner 1-113827/+0
2022-03-15Update Dockerfile.baseGravatar Jarred Sumner 1-1/+1
2022-03-15Add rust and lolhtml to dockerfileGravatar Jarred Sumner 2-0/+20
2022-03-15bump webkitGravatar Jarred Sumner 1-1/+1
2022-03-15Update WebKitGravatar Jarred Sumner 1-0/+0
2022-03-15:camera:Gravatar Jarred Sumner 60-799/+859
2022-03-15Fix test failureGravatar Jarred Sumner 1-15/+17
2022-03-15[bun:error] handle errors without a name or messageGravatar Jarred Sumner 1-6/+11
2022-03-15Update pool.zigGravatar Jarred Sumner 1-0/+1
2022-03-15Load .env by defaultGravatar Jarred Sumner 2-0/+8
2022-03-15mimalloc interpose is buggyGravatar Jarred Sumner 1-2/+25
2022-03-15higher max http requests for bun.jsGravatar Jarred Sumner 1-0/+29
2022-03-15zero copyGravatar Jarred Sumner 1-21/+15
2022-03-15Update javascript.zigGravatar Jarred Sumner 1-2/+0
2022-03-15[bun.js] utf8 console.{time, count, timeEnd, profile, profileEnd, count, cou...Gravatar Jarred Sumner 1-16/+16