4 ms·
Love Lapis. Question, since Lapis just transcode Moonscript into Lua to be used with OpenResty - why is Lapis so much slower than raw OpenResty/Lua? https://w
by tiffanyh 10y ago
Love Lapis.
Question, since Lapis just transcode Moonscript into Lua to be used with OpenResty - why is Lapis so much slower than raw OpenResty/Lua?
https://www.techempower.com/benchmarks/ https://www.techempower.com/benchmarks/
- killin_dan 10y agoBecause the lua code moonsript emits is inherently slower.
- tiffanyh 10y ago>> "inherently slower" What's "inherent" in moonscript that makes it slower?
- meowface 10y agoNot necessarily. Like CoffeeScript, it depends on what features you use.
- leafo 10y agoNot really, the code mapping is very straightforward and generally has no performance degradation. There are some language constructs that are implemented in a way that can create anonymous functions in order to convert statements into expressions. Future versions of MoonScript can do a better job to eliminate those. If you're aware when they're generated you can avoid them by writing as you might do in Lua. Realistically though, the performance difference is negligible in comparison to all the other things that might happen in your average web request.
- mtw 10y ago"slower" : I see Lapis is ahead of most frameworks, except platform or micro frameworks coded in C++, C or java. I think people should notice instead it's one of the fastest frameworks?
- tiffanyh 10y agoDid you compare Lapis to OpenResty in the benchmark above? In case you're not aware Lapis = Moonscript + OpenResty. And Moonsript is like Coffeescript but for Lua
- kraftman 10y agoLapis ~= Moonscript + OpenResty, Lapis = OpenResty + loads of framework stuff to make development easier, as Leafo explained. You can use Moonscript, but you can also use pure Lua.
- leafo 10y agoLapis is an entire web framework, OpenResty is a relatively low level interface to nginx. Lapis is an abstraction on top of OpenResty's Lua interface to make developing large web applications much more manageable. It has nothing to do with MoonScript. MoonScript generates speedy code.
- tiffanyh 10y agoAny plans to focus on increasing Lapis performance to be closer to raw OpenResty?