]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
add several more R_TimeReport calls for better analysis of csqc time
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 25 Feb 2010 15:55:47 +0000 (15:55 +0000)
committerRudolf Polzer <rpolzer@grawp.div0.qc.to>
Fri, 26 Feb 2010 11:50:57 +0000 (12:50 +0100)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9998 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=88d7d61be53c082f488ce7e1f25de1e095ed4fdf

cl_parse.c
clvm_cmds.c
csprogs.c
host.c
netconn.c

index 8b5bc0ac1fc1c2b0ed4bf6259de59fff72eb6034..57941d354f8285a350ff8f231d12ffd251800c33 100644 (file)
@@ -3630,6 +3630,7 @@ void CL_ParseServerMessage(void)
 
                        if (cmd == -1)
                        {
+                               R_TimeReport("END OF MESSAGE");
                                SHOWNET("END OF MESSAGE");
                                break;          // end of message
                        }
@@ -4074,22 +4075,29 @@ void CL_ParseServerMessage(void)
                                CL_ParsePointParticles1();
                                break;
                        }
+                       R_TimeReport(svc_strings[cmd]);
                }
        }
 
        if (cls.signon == SIGNONS)
                CL_UpdateItemsAndWeapon();
+       R_TimeReport("UpdateItems");
 
        EntityFrameQuake_ISeeDeadEntities();
+       R_TimeReport("ISeeDeadEntities");
 
        CL_UpdateMoveVars();
+       R_TimeReport("UpdateMoveVars");
 
        parsingerror = false;
 
        // LordHavoc: this was at the start of the function before cl_autodemo was
        // implemented
        if (cls.demorecording)
+       {
                CL_WriteDemoMessage (&net_message);
+               R_TimeReport("WriteDemo");
+       }
 }
 
 void CL_Parse_DumpPacket(void)
index 1031110c811eb67d82cb001dfc770339c68aceac..ff8f3da462483a184bd238509916f14f56e8d198 100644 (file)
@@ -252,6 +252,8 @@ static void VM_CL_traceline (void)
        int             move, svent;
        prvm_edict_t    *ent;
 
+       R_TimeReport("pretraceline");
+
        VM_SAFEPARMCOUNTRANGE(4, 4, VM_CL_traceline);
 
        prog->xfunction->builtinsprofile += 30;
@@ -267,6 +269,7 @@ static void VM_CL_traceline (void)
        trace = CL_TraceLine(v1, v2, move, ent, CL_GenericHitSuperContentsMask(ent), CL_HitNetworkBrushModels(move), CL_HitNetworkPlayers(move), &svent, true);
 
        CL_VM_SetTraceGlobals(&trace, svent);
+       R_TimeReport("traceline");
 }
 
 /*
@@ -288,6 +291,7 @@ static void VM_CL_tracebox (void)
        int             move, svent;
        prvm_edict_t    *ent;
 
+       R_TimeReport("pretracebox");
        VM_SAFEPARMCOUNTRANGE(6, 8, VM_CL_tracebox); // allow more parameters for future expansion
 
        prog->xfunction->builtinsprofile += 30;
@@ -305,6 +309,7 @@ static void VM_CL_tracebox (void)
        trace = CL_TraceBox(v1, m1, m2, v2, move, ent, CL_GenericHitSuperContentsMask(ent), CL_HitNetworkBrushModels(move), CL_HitNetworkPlayers(move), &svent, true);
 
        CL_VM_SetTraceGlobals(&trace, svent);
+       R_TimeReport("tracebox");
 }
 
 trace_t CL_Trace_Toss (prvm_edict_t *tossent, prvm_edict_t *ignore, int *svent)
index ff127451a2712c0db12ee34c29b74fc6de44ba24..966a12ceb8de4e75baef83ff9af03728e85d6503 100644 (file)
--- a/csprogs.c
+++ b/csprogs.c
@@ -339,6 +339,7 @@ qboolean CL_VM_UpdateView (void)
 //     vec3_t oldangles;
        if(!cl.csqc_loaded)
                return false;
+       R_TimeReport("pre-UpdateView");
        CSQC_BEGIN
                //VectorCopy(cl.viewangles, oldangles);
                prog->globals.client->time = cl.time;
@@ -356,6 +357,7 @@ qboolean CL_VM_UpdateView (void)
                // Dresk : Reset Dmg Globals Here
                CL_VM_UpdateDmgGlobals(0, 0, emptyvector);
        CSQC_END
+       R_TimeReport("UpdateView");
        return true;
 }
 
diff --git a/host.c b/host.c
index 9d2f534c163d4840a2b2983ce2d99076bfec2fa9..d3e17cd1b760d4c58b8080ab6adf6840bf17d3c4 100644 (file)
--- a/host.c
+++ b/host.c
@@ -700,6 +700,7 @@ void Host_Main(void)
                if (sv.active ? sv_timer > 0 : cl_timer > 0)
                {
                        // process console commands
+                       R_TimeReport("preconsole");
                        CL_VM_PreventInformationLeaks();
                        Cbuf_Execute();
                        R_TimeReport("console");
@@ -724,6 +725,7 @@ void Host_Main(void)
                        else
                                Sys_Sleep((int)wait);
                        svs.perf_acc_sleeptime += Sys_DoubleTime() - time0;
+                       R_TimeReport("sleep");
                        continue;
                }
 
@@ -895,21 +897,27 @@ void Host_Main(void)
                        // update video
                        if (host_speeds.integer)
                                time1 = Sys_DoubleTime();
+                       R_TimeReport("pre-input");
 
                        // Collect input into cmd
                        CL_Input();
 
+                       R_TimeReport("input");
+
                        // check for new packets
                        NetConn_ClientFrame();
 
                        // read a new frame from a demo if needed
                        CL_ReadDemoMessage();
+                       R_TimeReport("clientnetwork");
 
                        // now that packets have been read, send input to server
                        CL_SendMove();
+                       R_TimeReport("sendmove");
 
                        // update client world (interpolate entities, create trails, etc)
                        CL_UpdateWorld();
+                       R_TimeReport("lerpworld");
 
                        CL_Video_Frame();
                        CL_Gecko_Frame();
index 4e80136d47643dd9b77608de446abc66d63dfa6a..075ecd8d3ffe188206b40d16c7129e3e53a1385f 100755 (executable)
--- a/netconn.c
+++ b/netconn.c
@@ -2125,8 +2125,14 @@ void NetConn_ClientFrame(void)
                SZ_Clear(&net_message);
        }
        for (i = 0;i < cl_numsockets;i++)
+       {
                while (cl_sockets[i] && (length = NetConn_Read(cl_sockets[i], readbuffer, sizeof(readbuffer), &peeraddress)) > 0)
+               {
+                       R_TimeReport("clientreadnetwork");
                        NetConn_ClientParsePacket(cl_sockets[i], readbuffer, length, &peeraddress);
+                       R_TimeReport("clientparsepacket");
+               }
+       }
        NetConn_QueryQueueFrame();
        if (cls.netcon && realtime > cls.netcon->timeout && !sv.active)
        {