Any way to speed up the performance? #371
Replies: 7 comments
-
What are you using it for? Personally I would recommend using CGo bindings to luajit if you need performance... Otherwise use something else. |
Beta Was this translation helpful? Give feedback.
-
I think gopher-lua`s performance is enough. I have been using gopher-lua in my game server.And I think using cgo maybe worse than using gopher-lua |
Beta Was this translation helpful? Give feedback.
-
Well, cgo would have more overhead, but it is definitely faster than gopher
Lua. I guess this all depends on how fast you need. If you want to use lua
for a game server, use luajit. If you want to extend a go-based game server
with plugins or hot swapping, use gopher Lua. I would prefer a type safe
language with high performance for game server given the requirements of
low latency over UDP being pretty common. Lua has the problem of
encountering type errors during runtime which can be very annoying.
…-sent from my OnePlus X
On May 8, 2018 6:22 AM, "Cyinx" <notifications@github.com> wrote:
I think gopher-lua`s performance is enough. I have been using gopher-lua in
my game server.
https://github.com/Cyinx/einx
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#143 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AIIciBRC6ybdWmwpNcuIXi-FA4XtI2Uxks5twXHtgaJpZM4P1l-a>
.
|
Beta Was this translation helpful? Give feedback.
-
You are right.It depends on how fast you need.So I put the battle logic in golang,and other logic in lua. |
Beta Was this translation helpful? Give feedback.
-
Almost certainly. The overhead may be higher, but generally the performance
should be better. Luajit with go would have the best possible performance.
My question is, why use Lua here at all? I love the language, but go is
very capable... Why do you need anything else?
…-sent from my OnePlus X
On Wed, May 9, 2018, 10:55 PM Cyinx ***@***.***> wrote:
You are right.It depends on how fast you need.So I put the battle logic in
golang,and other logic in lua.
Well,I would like to use luajit,but i dont know whether GC64 is ready for
producer.Do you think cgo+lua5.1 can be faster than gopher-lua?
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#143 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIIciOlladQ-1cKV8h71ir8aOlI_21ioks5tw6wXgaJpZM4P1l-a>
.
|
Beta Was this translation helpful? Give feedback.
-
Well,it is easier to hire a lua progammer than golang progammer or c++ progammer in my city. |
Beta Was this translation helpful? Give feedback.
-
True. But here are my two cents. Don't look to hire Go programmers. Hire
good programmers who have done work with C, Java, maybe Python etc. Those
programmers with have a very easy time joining a Go-based project given the
language is so simple. Additionally, While I understand that design goals
may change, this is not really a problem meant to be solved by a
programming language. Both Go and Lua can be written in a way that makes it
easy to refactor, rewrite and repurpose code when your game designer
changes everything. Functional programming may be a helpful paradigm
here... SCRUM or Waterfall may also be useful. I've used Lua extensively
for both a game and parts of its networking systems. Lua and Go both are
great languages with different tradeoffs, but I often find that Lua is
faster to write, but it is also makes for buggier code given the weak
typing and dynamic nature of the language. Additionally, Lua has very few
libraries compared to the many thousands of Go libraries in existance (Go
has the bigger community).
In short, Lua is good at a few things... and maybe fun to write. C/C++
interop, dynamic typing with decent performance (LuaJIT), plugins and
embedded use. Go is good for large, complex programs on the backend that
require a team of developers to be productive and write useful programs. Go
is much more like a Java replacement, with a focus on being easy to learn,
and easy to write. I would take advantage of Go's features and just use it
for everything you can on the backend, only using Lua or Gopher-Lua where
absolutely necessary. While Lua + Go is a cool prospect, it takes alot of
work to get stable, productional quality interop between two languages with
completely different designs and goals. YMMV
…On Wed, May 9, 2018 at 11:59 PM, Cyinx ***@***.***> wrote:
Well,it is easier to hire a lua progammer than golang progammer or c++
progammer in my city.
And our gd(Game Designer) is so idiot that they change their design every
day,so we need a flexible script language to write logic...
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#143 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AIIciPDAM1FGA2UPan-YqwxFHIjAIFJpks5tw7sIgaJpZM4P1l-a>
.
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I decide to use gopher-lua in my game server.
But I want to improve the performance. Is there any tricks to do?
Beta Was this translation helpful? Give feedback.
All reactions