1. Post #1
    sk89q's Avatar
    December 2009
    362 Posts
    Are networked strings pooled? Keys too?

    (I also assume that they are synchronized with clients when they join the server?)

  2. Post #2
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    No.

    Edited:

    Nothing in the SetNW*() functions is pooled.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Agree Agree x 1 (list)

  3. Post #3
    Gold Member
    Gbps's Avatar
    December 2008
    3,645 Posts
    Azuisleet would like to differ.

    Edited:

    There's a string table called lua string table, so yes, they are pooled.
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 1Disagree Disagree x 1 (list)

  4. Post #4
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    ...
    No.
    Rather than discussing how and why you are wrong, here is a link to the relevant thread and here is the quick summary.
    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);
    
    No decernable change.
    Looks like I'll have to go for preshared keys as much as possible to cut down overhead. :/
    Edited:

    In fact, you were there at the time.

  5. Post #5
    Gold Member
    Gbps's Avatar
    December 2008
    3,645 Posts
    The reason there is no change is because they are already pooled....

    Edited:

    The keys are pooled, not the values.
    Reply With Quote Edit / Delete Reply United States Show Events Dumb Dumb x 1 (list)