-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
too many heap allocs/escapes in sipcallmon #9
Comments
Stats at the end of the run on timestamp branch, cmd line as above (10x speed, no debugging a.s.o.).
|
Added a new branch (timestamp): intuitivelabs/calltr@c8629be Measurements (not very precise due to frequency scaling):
Results:
Graphs: |
Same test, this time with my new wheel timers, 1ms tick, version alpha (still some dbg, very lightly tested):
|
Latest profiling form mem:
|
Unfortunately cpu frequency scaling interfered with most of the measurements so probably the latest numbers are much better (since the cpu did run only at 2.6-28Ghz from 3.3Ghz). I've tried increasing the replay speed. Look like 33x (-replay_scale 0.03) is close to the maximum (cpu gets to max frequency and trying bigger speed-ups seems to run the pcap no faster then 33x, have to investigate if the problem is not from the replay code). Results at 33x:
|
Use high performance hierarchical timing wheel based timers. Massive overall performance improvement, 2+x faster and less then half the memory usage. See also: #9, intuitivelabs/sipcallmon#9
Use different size pools to get the memory blocks. Each of the common block size will get its own pool. The pool use sync.Pool via bytespool. Unfortunately since we allocate bytes blocks that we force cast to our required data structure (CallEntry + buffer or RegEntry + buffer), the go GC will never see the pointers in the structs inside our blocks and will consider the free for taking at the next run. To work around this we keep a pointer to each allocated block in a separate list (see alloc_plist.go). This "list" is in fact a simple linked list of pointer blocks of page size. Locking is used only when a new page-size pointer block needs to be added or freed (otherwise only atomic operations are used). It brings another 12% cpu and 3% memory improvement. See /intuitivelabs/sipcallmon#9
From intuitive-issues created by poandrei: intuitivelabs/intuitive-issues#262
Some code in sipcallmon causes too many heap allocs/escapes.
Heap profile on evring_avoid_escapes branch, 30s allocs:
(go tool pprof -trim_path=/go/ -inuse_objects heap)
The text was updated successfully, but these errors were encountered: