Skip to content
crazy2be edited this page Apr 22, 2013 · 6 revisions

How to profile the server

Add or uncomment the following line at the top of main() in server/server.go:

go doProfile()

And start the server. Do whatever behaviour you wish to profile. You have 2 minutes before the server exits automatically and dumps it's profile.

When the server exits,

cd client
go tool pprof ../server/bin/server cpuprofile

You are now in pprof. See http://blog.golang.org/2011/06/profiling-go-programs.html for information on how to use it.

Useful Links

Valve article on latency compensation: https://developer.valvesoftware.com/wiki/Latency_Compensating_Methods_in_Client/Server_In-game_Protocol_Design_and_Optimization

PTP Protocol for client/server time synchronization: http://en.wikipedia.org/wiki/Precision_Time_Protocol#Synchronization

NVIDA presentation on WebGL performance: https://docs.google.com/presentation/d/12AGAUmElB0oOBgbEEBfhABkIMCL3CUX7kdAPLuwZ964/edit#slide=id.i281

Series of articles about the GPU pipeline: http://fgiesen.wordpress.com/2011/07/09/a-trip-through-the-graphics-pipeline-2011-index/

Apple developer guide for OpenGL ES (similar to WebGL): http://developer.apple.com/library/ios/#documentation/3DDrawing/Conceptual/OpenGLES_ProgrammingGuide/Introduction/Introduction.html

WebGL cheat sheet: http://www.nihilogic.dk/labs/webgl_cheat_sheet/WebGL_Cheat_Sheet.htm (not that useful since we don't use raw WebGL atm)

OpenGL wiki page on how to best specify vertices: http://www.opengl.org/wiki/Vertex_Specification_Best_Practices

Google presentation on implementing google body in WebGL: https://docs.google.com/presentation/d/1p8xPqkpe8XyFeAWdzZcX7naiSN0vcibQqaKQqaCCuVU/present#slide=id.i218

WebGL demo repository: http://www.khronos.org/webgl/wiki/Demo_Repository

Go raytracer:
This is a raytrace renderer, we don't really need all that this provides. It contains a good starting point though.
https://github.com/Byron/gotracer

For our static, aabb (axis-aligned bounding-box) worlds:
http://tavianator.com/2011/05/fast-branchless-raybounding-box-intersections/
(or google "ray aabb slab")

Clone this wiki locally