• Are networked strings pooled?
    5 replies, posted
  • Avatar of sk89q
  • Are networked strings pooled? Keys too? (I also assume that they are synchronized with clients when they join the server?)
  • Avatar of lexic
  • No. [editline]08:19PM[/editline] Nothing in the SetNW*() functions is pooled.
  • Avatar of Gbps
  • Azuisleet would like to differ. [editline]02:34PM[/editline] There's a string table called lua string table, so yes, they are pooled.
  • Avatar of lexic
  • ... No. Rather than discussing how and why you are wrong, [url=http://www.facepunch.com/showthread.php?t=894211]here is a link to the relevant thread[/url] and here is the quick summary. [QUOTE=Lexic;20381699][lua]a = { "qwertyuiop[]qwertyuiop[]qwertyuiop[]qwertyuiop[]qwertyuiop[]qwertyuiop[]qwertyuiop[]", "asdfghjkl;asdfghjkl;asdfghjkl;asdfghjkl;asdfghjkl;asdfghjkl;asdfghjkl;", "zxcvbnm,./zxcvbnm,./zxcvbnm,./zxcvbnm,./zxcvbnm,././zxcvbnm,././zxcvbnm,./s"}; i = 1; function doincrement() i = i + 1; if (i > 3) then i = 1; end end timer.Create("dotransfers",0.5,0,function() local ply = Entity(1); doincrement(); ply:SetNWString("String1",a[i]); doincrement(); ply:SetNWString("String2",a[i]); doincrement(); ply:SetNWString("String3",a[i]); doincrement(); end); concommand.Add("poolnames",function() umsg.PoolString("String1"); umsg.PoolString("String2"); umsg.PoolString("String3"); end); concommand.Add("poolcontents",function() for i = 1, 3 do umsg.PoolString(a[i]); end end); [/lua] No decernable change. Looks like I'll have to go for preshared keys as much as possible to cut down overhead. :/[/QUOTE] [editline]08:40PM[/editline] In fact, you were there at the time.
  • Avatar of Gbps
  • The reason there is no change is because they are already pooled.... :v: [editline]11:18PM[/editline] The keys are pooled, not the values.
  • [url=http://www.blingforfun.com/personalized-engravings/cat_40.html]personalized gift ideas[/url] [highlight](User was permabanned for this post ("Spambot" - postal))[/highlight]