Skip to content

Conversation

@Leilei332
Copy link
Contributor

This does not solve #6839

Replace window["eval"] with Function constructor, which has better performance.

@netlify
Copy link

netlify bot commented Jan 24, 2026

Deploy Preview for tiddlywiki-previews ready!

Name Link
🔨 Latest commit cb69c90
🔍 Latest deploy log https://app.netlify.com/projects/tiddlywiki-previews/deploys/697429681c6c9d0008312232
😎 Deploy Preview https://deploy-preview-9611--tiddlywiki-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link

Confirmed: Leilei332 has already signed the Contributor License Agreement (see contributing.md)

@github-actions
Copy link

github-actions bot commented Jan 24, 2026

📊 Build Size Comparison: empty.html

Branch Size
Base (master) 2448.0 KB
PR 2447.9 KB

Diff: ⬇️ Decrease: 0.0 KB


⚠️ Change Note Status

This PR appears to contain code changes but doesn't include a change note.

Please add a change note by creating a .tid file in editions/tw5.com/tiddlers/releasenotes/<version>/

📚 Documentation: Release Notes and Changes

💡 Note: If this is a documentation-only change, you can ignore this message.

@pmario
Copy link
Member

pmario commented Jan 24, 2026

...which has better performance.

What do you mean by that? Is the function call faster, or is the "jit" compiled code faster. Does it have any impact on debug ability?

@Leilei332
Copy link
Contributor Author

...which has better performance.

What do you mean by that? Is the function call faster, or is the "jit" compiled code faster.

I did checked the docs. It did mention performance benefits:

Using the Function() constructor
The Function() constructor is very similar to the indirect eval example above: it also evaluates the JavaScript source passed to it in the global scope without reading or mutating any local bindings, and therefore allows engines to do more optimizations than direct eval().

So I think there do have some slight performance benefits.

Does it have any impact on debug ability?

After checking, using debugger keyword do work like before.

@saqimtiaz saqimtiaz moved this to Needs feedback in Planning for v5.4.0 Jan 25, 2026
@saqimtiaz saqimtiaz moved this from Needs feedback to Ready in Planning for v5.4.0 Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

2 participants