Which one has better performance ? Updating User Variables or sending Extension Response continuously ?

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

edwinharly
Posts: 4
Joined: 23 Oct 2017, 01:46

Which one has better performance ? Updating User Variables or sending Extension Response continuously ?

Postby edwinharly » 22 Mar 2018, 09:07

Hi,

I saw on this example http://docs2x.smartfoxserver.com/ExamplesUnity/object-movement, they update each player's coordinate on UserVariables. Currently, I'm working on a fast action shooting game and I use ExtensionRequest and ExtensionResponse to broadcast each player's position, so I wanna know which method has better performance ?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Which one has better performance ? Updating User Variables or sending Extension Response continuously ?

Postby Lapo » 22 Mar 2018, 09:18

Hi,
using ExtensioRequest and response is certainly the most flexible way to do it, as you can decide which data you want to send. Also ExtensionRequest allows you to switch between UDP and TCP protocols for every call, while UserVariables are TCP only.

Hope it helps
Lapo
--
gotoAndPlay()
...addicted to flash games
edwinharly
Posts: 4
Joined: 23 Oct 2017, 01:46

Re: Which one has better performance ? Updating User Variables or sending Extension Response continuously ?

Postby edwinharly » 22 Mar 2018, 09:23

Lapo wrote:Hi,
using ExtensioRequest and response is certainly the most flexible way to do it, as you can decide which data you want to send. Also ExtensionRequest allows you to switch between UDP and TCP protocols for every call, while UserVariables are TCP only.

Hope it helps


Ok, so comparing ExtensionRequest (using TCP) with UserVariables, which one has better performance ?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Which one has better performance ? Updating User Variables or sending Extension Response continuously ?

Postby Lapo » 22 Mar 2018, 09:44

I am not sure what you mean by performance?
If we're talking about hardware performance there is no difference. If we're talking about network performance there can be a minimal difference based on how you build the objects that you send. (e.g. smart use of numeric data types to minimize bandwidth)

In general the performance difference is negligible. What changes is the flexibility. Custom extension calls are more a bit more flexible because you can structure objects as you want.

Cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SFS2X Questions”

Who is online

Users browsing this forum: Bing [Bot] and 57 guests