fstirlitz / luaparse

A Lua parser written in JavaScript
https://fstirlitz.github.io/luaparse/
MIT License
459 stars 91 forks source link

PrintTable improvements #78

Closed Lautenschlager-id closed 4 years ago

Lautenschlager-id commented 4 years ago

It's also possible to use next, tb instead of pairs(tb) if you're not interested in getmetatable(tb).__pairs's behavior

fstirlitz commented 4 years ago

This script is never even run. It's just sample source code to be parsed when benchmarking. Why bother optimising it?

Lautenschlager-id commented 4 years ago

Because most, if not all, benchmarks do consider performance - which will usually be worse if not optimized

oxyc commented 4 years ago

Like @fstirlitz said, it's only parsed, it's never evaluated or executed so optimizing it really doesn't matter.

Feel free to open up the PR at the project's own repository though https://github.com/stravant/LuaMinify (it's an entirely different parser written in lua instead of js)