Hi,
We are currently at a stage in development in which we focus more
on making things run correctly rather than fast. Not to say we don't
care about performance ;) But we really didn't fine-tune everything yet.
The ctree_remove function is going to take the majority of the
allocation time no matter what, but the numbers you are getting are
probably a result of a bug. Can you please try your code with the
library from this branch (no API changes, just internals):
https://github.com/pbalcer/nvml/tree/obj_pmalloc_growYou should see a noticable improvement, here are the gprof results of a pmalloc(4k) in a loop(320k) benchmark:
Each sample counts as 0.01 seconds.
time seconds seconds calls ns/call ns/call name
33.34 0.03 0.03 pmalloc
22.22 0.05 0.02 320001 62.50 62.50 heap_get_block_data
11.11 0.06 0.01 320628 31.19 31.19 ctree_remove
11.11 0.07 0.01 320002 31.25 31.25 lane_hold
11.11 0.08 0.01 320001 31.25 31.25 heap_unlock_if_run
11.11 0.09 0.01 pmem_flush
I ran it several times, getting different results, but looks better than what I'm getting on current master.
If
you need more help, write me an email (piotr.balcer at
intel.com), I'm
also available on IRC. I'll be happy to inspect your code for any API
misuses.
Piotrek