René's URL Explorer Experiment


Title: Closing audit: prove the cumulative win of the optimisation series · Issue #187 · purescript-lua/purescript-lua · GitHub

Open Graph Title: Closing audit: prove the cumulative win of the optimisation series · Issue #187 · purescript-lua/purescript-lua

X Title: Closing audit: prove the cumulative win of the optimisation series · Issue #187 · purescript-lua/purescript-lua

Description: Problem The optimisation and correctness series (#172-#186 plus the standing correctness bugs and #24) is motivated by a set of one-off measurements taken against a single commit. Each individual issue defends its own local win, but noth...

Open Graph Description: Problem The optimisation and correctness series (#172-#186 plus the standing correctness bugs and #24) is motivated by a set of one-off measurements taken against a single commit. Each individual i...

X Description: Problem The optimisation and correctness series (#172-#186 plus the standing correctness bugs and #24) is motivated by a set of one-off measurements taken against a single commit. Each individual i...

Opengraph URL: https://github.com/purescript-lua/purescript-lua/issues/187

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Closing audit: prove the cumulative win of the optimisation series","articleBody":"## Problem\n\nThe optimisation and correctness series (#172-#186 plus the standing\ncorrectness bugs and #24) is motivated by a set of one-off measurements taken\nagainst a single commit. Each individual issue defends its own local win, but\nnothing yet ties the series together into a single before/after statement about\nthe generated code as a whole. Without that, \"we made the backend faster\" stays\nan anecdote spread across a dozen issues rather than one reproducible number.\n\nThis issue is the closing bracket of the series: it records the baseline as it\nstands today so that, once the series lands, the same harness can be re-run and\nthe cumulative effect stated in one table. It is deliberately blocked by every\nissue in the series, so it naturally sorts last and cannot be closed until the\nwork it audits is done.\n\n### Baseline (today)\n\nTimings are from the generated-Lua performance analysis (PUC Lua 5.1.5,\n`os.clock`) and from the harness motivation in #172 (LuaJIT 2.1). Each row\ncompares the current generated shape against the idiomatic / uncurried\nequivalent.\n\n| Pattern | Current generated | Ideal | Slowdown | Runtime |\n|---|---|---|---|---|\n| `fib(30)`, arithmetic via IIFE lambdas | 0.457 s | 0.055 s | 8.3× | PUC 5.1.5 |\n| `>=` via `ordInt` dictionary (5e6) | 1.165 s | 0.027 s | 42.4× | PUC 5.1.5 |\n| Monadic `bind` ×3 chain (1e6) | 0.736 s | 0.012 s | 63.3× | PUC 5.1.5 |\n| Curried application `f(a)(b)` (5e6) | 0.339 s | 0.079 s | 4.3× | PUC 5.1.5 |\n| `M.field` access vs local (1e7) | 0.090 s | 0.037 s | 2.4× | PUC 5.1.5 |\n| `Maybe` alloc + match, hash-part vs array-part (2e6) | 0.158 s | 0.113 s | 1.4× | PUC 5.1.5 |\n| Curried hot loop `acc = add(acc)(i)` (2e7) | 0.91 s | 0.017 s | 54× | LuaJIT 2.1 |\n| `Data.Array.foldl` driven by a curried step | 0.99 s | 0.012 s | 85× | LuaJIT 2.1 |\n\nTwo LuaJIT facts from #172 anchor the trace-compilation story: the curried hot\nloop runs the same with the JIT on (0.91 s) and with `-joff` (0.90 s). The JIT\nbuys nothing because every partial application emits an `FNEW` (closure\ncreation), which is NYI, so the trace recording aborts and the loop start is\nblacklisted. The uncurried loop compiles to a single trace. The same blacklist\nhits the `Data.Array.foldl` FFI `for` loop because the trace has to inline the\ncurried callee.\n\n### FNEW census (to capture via the harness)\n\nThe deterministic LuaJIT counter from #172's approach is the CI-friendly\nregression metric: the number of `FNEW` bytecodes in `luajit -bl` of a linked\nartifact, split into main-chunk (runs once at init) vs function-body (runs per\ncall) occurrences. It is not in this baseline because the #172 harness does not\nexist yet and `luajit` is not in the dev shell. Capturing the `Data_Array.lua`\nFNEW split is part of running the harness for the before snapshot.\n\n## Approach\n\n1. Land #172 (the benchmark harness); it is a prerequisite of this audit.\n2. Once the series is closed, re-run the #172 harness over the same linked\n   artifacts and micro/macro patterns.\n3. Fill the \"after\" column of the table above and the FNEW census, and state\n   the cumulative multiplier per pattern.\n\nNo code change ships from this issue; its deliverable is the before/after\ntable and the FNEW deltas.\n\n## Verification / Measurement\n\nThe filled-in table above is the verification. The pass criterion is that the\nhot patterns move from the double-digit slowdowns recorded here toward small\nsingle-digit factors over idiomatic Lua, and that the function-body FNEW count\nin `Data_Array.lua` drops materially. The exact target numbers are set when the\nharness produces the \"after\" snapshot.\n\n## Prerequisites / Relations\n\nBlocked by the whole series: every correctness bug and performance\noptimisation whose effect this audit measures. Feature issues (#27, #72) are\nout of scope and are not blockers.\n","author":{"url":"https://github.com/Unisay","@type":"Person","name":"Unisay"},"datePublished":"2026-07-06T11:58:50Z","url":"https://github.com/purescript-lua/purescript-lua/issues/187"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:72b60712-87fc-1e9c-85cf-58343fea19c6
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idABEE:19E4BB:659F80:83AB7B:6B00E059
html-safe-nonceb9c87c5db4f324ca7ef6bb8322cf4b31e7692c9fbc7f39eb1c27f178c67dd1dd
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkVFOjE5RTRCQjo2NTlGODA6ODNBQjdCOjZCMDBFMDU5IiwidmlzaXRvcl9pZCI6IjU4MTQ3MzQxOTU1MTUyNTI4MjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmacf6a4bc7149db77eb206f2bdbebcc79982afec68b4f9f02016d9d9ec8dc88a44e
hovercard-subject-tagissue:4818875426
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/purescript-lua/purescript-lua/187/issue_layout
twitter:imagehttps://opengraph.githubassets.com/eb9b0b1e2529be75ec96f2c8a6c723bdc9199042d6f5b720e63501b058b2ef98/purescript-lua/purescript-lua/issues/187
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/eb9b0b1e2529be75ec96f2c8a6c723bdc9199042d6f5b720e63501b058b2ef98/purescript-lua/purescript-lua/issues/187
og:image:altProblem The optimisation and correctness series (#172-#186 plus the standing correctness bugs and #24) is motivated by a set of one-off measurements taken against a single commit. Each individual i...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameUnisay
hostnamegithub.com
expected-hostnamegithub.com
None043c3f30fbcbe2c6c8e729e10cbbbc90c406546f9fbbb67c648d38f6b7d16daf
turbo-cache-controlno-preview
go-importgithub.com/purescript-lua/purescript-lua git https://github.com/purescript-lua/purescript-lua.git
octolytics-dimension-user_id131581790
octolytics-dimension-user_loginpurescript-lua
octolytics-dimension-repository_id587200487
octolytics-dimension-repository_nwopurescript-lua/purescript-lua
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id587200487
octolytics-dimension-repository_network_root_nwopurescript-lua/purescript-lua
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
release5425dc24e8bd8d6fca9641a12afc984825a43875
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/purescript-lua/purescript-lua/issues/187#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2F187
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
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
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://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/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpurescript-lua%2Fpurescript-lua%2Fissues%2F187
Sign uphttps://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=purescript-lua%2Fpurescript-lua
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/187
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/187
Reloadhttps://github.com/purescript-lua/purescript-lua/issues/187
purescript-luahttps://github.com/purescript-lua
purescript-luahttps://github.com/purescript-lua/purescript-lua
Codehttps://github.com/purescript-lua/purescript-lua
Issues48 (48)https://github.com/purescript-lua/purescript-lua/issues
Pull requestshttps://github.com/purescript-lua/purescript-lua/pulls
Discussionshttps://github.com/purescript-lua/purescript-lua/discussions
Actionshttps://github.com/purescript-lua/purescript-lua/actions
Projectshttps://github.com/purescript-lua/purescript-lua/projects
Security and qualityhttps://github.com/purescript-lua/purescript-lua/security
Insightshttps://github.com/purescript-lua/purescript-lua/insights
https://github.com/purescript-lua/purescript-lua
New issuehttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/187
New issuehttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/187
Closing audit: prove the cumulative win of the optimisation serieshttps://github.com/purescript-lua/purescript-lua/issues/187#top
area: toolchainnix / spago / purs / buildhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20toolchain%22
choreMaintenance / infrastructurehttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22chore%22
https://github.com/Unisay
Unisayhttps://github.com/Unisay
on Jul 6, 2026https://github.com/purescript-lua/purescript-lua/issues/187#issue-4818875426
#172https://github.com/purescript-lua/purescript-lua/issues/172
#186https://github.com/purescript-lua/purescript-lua/issues/186
#24https://github.com/purescript-lua/purescript-lua/issues/24
#172https://github.com/purescript-lua/purescript-lua/issues/172
#172https://github.com/purescript-lua/purescript-lua/issues/172
#172https://github.com/purescript-lua/purescript-lua/issues/172
#172https://github.com/purescript-lua/purescript-lua/issues/172
Benchmark harness: PUC Lua timings and LuaJIT trace/FNEW counters for generated code #172https://github.com/purescript-lua/purescript-lua/issues/172
Benchmark harness: PUC Lua timings and LuaJIT trace/FNEW counters for generated code #172https://github.com/purescript-lua/purescript-lua/issues/172
#27https://github.com/purescript-lua/purescript-lua/issues/27
#72https://github.com/purescript-lua/purescript-lua/issues/72
Unisayhttps://github.com/Unisay
area: toolchainnix / spago / purs / buildhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20toolchain%22
choreMaintenance / infrastructurehttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22chore%22
on Jul 6, 2026https://github.com/purescript-lua/purescript-lua/issues/187#event-27606190116
Unisayhttps://github.com/Unisay
on Jul 6, 2026https://github.com/purescript-lua/purescript-lua/issues/187#event-27606207025
Benchmark harness: PUC Lua timings and LuaJIT trace/FNEW counters for generated code #172https://github.com/purescript-lua/purescript-lua/issues/172
Program transformation to uncurry functions for which all applications are fully saturated. #24https://github.com/purescript-lua/purescript-lua/issues/24
optimizeModule recomputes whole-module free-reference counts per binding #142https://github.com/purescript-lua/purescript-lua/issues/142
isUsedOnce counts references against stale bindings during inlining #143https://github.com/purescript-lua/purescript-lua/issues/143
Lua.fromIR: topLevelNames parameter is always empty, guarded branches are dead code #146https://github.com/purescript-lua/purescript-lua/issues/146
betaReduce substitutes a non-trivial argument into every occurrence of the parameter, multiplying work #167https://github.com/purescript-lua/purescript-lua/issues/167
collectDataDeclarations classifies types by constructor adjacency, so a reordered CoreFn would silently break pattern matching #168https://github.com/purescript-lua/purescript-lua/issues/168
Dissolving a bare-Ref alias to an @inline always binding multiplies the inlined body across all use sites #171https://github.com/purescript-lua/purescript-lua/issues/171
reduceObjectProp leaks the FFI @inline always annotation onto unrelated bindings, forcing unconditional duplication #169https://github.com/purescript-lua/purescript-lua/issues/169
Replace the lexical foreign splitter with a real Lua 5.1 parser producing the Lua AST #173https://github.com/purescript-lua/purescript-lua/issues/173
Revisit M-table binding storage: per-function caching and budget-aware chunk locals #174https://github.com/purescript-lua/purescript-lua/issues/174
Foreign table-constructor exports are duplicated per use site (fresh identity and allocation per copy) #175https://github.com/purescript-lua/purescript-lua/issues/175
[fork-ffi] prelude: flip @inline unit always to never — inlining unit duplicates the singleton allocation #176https://github.com/purescript-lua/purescript-lua/issues/176
Fold ReflectCtor and DataArgumentByIndex over known constructor applications (case-of-known-constructor) #177https://github.com/purescript-lua/purescript-lua/issues/177
Lift the pure subset of foreign values into the IR: primop nodes and an allowlist-driven lifter #178https://github.com/purescript-lua/purescript-lua/issues/178
Introduce the n-ary AppN call node (replace unary App) #179https://github.com/purescript-lua/purescript-lua/issues/179
Budgeted call-site inlining of dictionary methods to collapse non-Effect/ST monadic chains #180https://github.com/purescript-lua/purescript-lua/issues/180
Lower self-recursive tail calls of uncurried workers to while loops (loopification) #181https://github.com/purescript-lua/purescript-lua/issues/181
MagicDo: recognize Effect/ST chains by qualified name at translation instead of by shape (removes the post-DCE ordering constraint) #182https://github.com/purescript-lua/purescript-lua/issues/182
Conservative CSE for effect-free-by-construction IR subexpressions #183https://github.com/purescript-lua/purescript-lua/issues/183
Unisayhttps://github.com/Unisay
on Jul 6, 2026https://github.com/purescript-lua/purescript-lua/issues/187#event-27606257458
Case decision tree: MatchHistory prunes only constructor tests — extend to literal patterns and accumulate negatives #184https://github.com/purescript-lua/purescript-lua/issues/184
Array-part constructor representation: {tag, v0, v1} instead of hash-part {$ctor=…, value0=…} #185https://github.com/purescript-lua/purescript-lua/issues/185
[fork-ffi] Performance audit across the Lua forks: uncurried shapes for Lua-specific foreigns, string accumulation, fallback coverage #186https://github.com/purescript-lua/purescript-lua/issues/186
Sign up for freehttps://github.com/signup?return_to=https://github.com/purescript-lua/purescript-lua/issues/187
Sign in to commenthttps://github.com/login?return_to=https://github.com/purescript-lua/purescript-lua/issues/187
area: toolchainnix / spago / purs / buildhttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22area%3A%20toolchain%22
choreMaintenance / infrastructurehttps://github.com/purescript-lua/purescript-lua/issues?q=state%3Aopen%20label%3A%22chore%22
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.