Im-dex / xray-162

XRay engine 1.6.2 (S.T.A.L.K.E.R: Call of Pripyat) evolution
Apache License 2.0
47 stars 12 forks source link

TBB allocator integration #26

Open Im-dex opened 7 years ago

Im-dex commented 7 years ago

Replace standard allocator by the Intel TBB scalable allocator

jazzvaz commented 6 years ago

@Im-dex do we really need it, and if yes, in which case? I think it is better just to use it as needed.

Im-dex commented 6 years ago

@jazzvaz It is useful in case when a multithreading is actively added to the engine

jazzvaz commented 6 years ago

@Im-dex what did you mean by replace STANDART allocator? stl type allocator or xr_memory itself?

Im-dex commented 6 years ago

@jazzvaz all of them, there must be only one tbb's allocator

jazzvaz commented 6 years ago

@Im-dex what about pools that xr_memory uses?

Im-dex commented 6 years ago

@jazzvaz they should all be removed

jazzvaz commented 6 years ago

@Im-dex performance will drop a lot

Im-dex commented 6 years ago

@jazzvaz why?

jazzvaz commented 6 years ago

@Im-dex I might be wrong, but I think gsc did good job with memory optimization. Then to remove it, tbb malloc proxy can be used instead of allocator

Im-dex commented 6 years ago

@jazzvaz I think Intel did a much better job than gsc :) anyway, tbb malloc already contains thread caching pools.

jazzvaz commented 6 years ago

@Im-dex so what is better: malloc proxy or scalable allocator? Furthermore, pool is faster with dealing many allocation and deallocation as calling malloc itself.

Im-dex commented 6 years ago

@jazzvaz What do you mean? scalable allocator is an allocator, malloc proxy is a way to use scalable allocator

jazzvaz commented 6 years ago

@Im-dex yes, that why I asked, what will be the better implementation: create an allocator or use proxy for malloc?

Im-dex commented 6 years ago

@jazzvaz I think proxy will be enough

jazzvaz commented 6 years ago

@Im-dex do we need from xr_memory: debug memory name, debug memory monitor, memory stats?

Im-dex commented 6 years ago

@jazzvaz nope

jazzvaz commented 6 years ago

@Im-dex Can I open pull request now and fill it with time as commits will be big, and you will need time to revise it?

Im-dex commented 6 years ago

@jazzvaz Yes, but keep in mind that it will be better to open one pr for one kind of changes (e.g. macros removing, one feature adding) cause it easier for review and makes merge faster.