<div dir="ltr">On 25 May 2013 03:55, deadalnix <span dir="ltr"><<a href="mailto:deadalnix@gmail.com" target="_blank">deadalnix@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Friday, 24 May 2013 at 15:17:00 UTC, Manu wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Errr, well, 1ms is about 7% of the frame, that's quite a long time.<br>
I'd be feeling pretty uneasy about any library that claimed to want 7% of<br>
the whole game time, and didn't offer any visual/gameplay benefits...<br>
Maybe if the GC happened to render some sweet water effects, or perform<br>
some awesome cloth physics or something while it was at it ;)<br>
I'd say 7% is too much for many developers.<br>
<br>
I think 2% sacrifice for simplifying memory management would probably get<br>
through without much argument.<br>
That's ~300µs... a few hundred microseconds seems reasonable. Maybe a<br>
little more if targeting 30fps.<br>
If it stuck to that strictly, I'd possibly even grant it permission to stop<br>
the world...<br>
<br>
</blockquote>
<br></div>
That is kind of biased, as you'll generally win on other aspects. You don't free anymore, you don't need to count reference (which can become qui te costly in multithreaded code), etc . . .<br></blockquote><div>
<br></div><div style>Freeing is a no-realtime-cost operation, since memory management is usually scheduled for between-scenes, or passed to other threads.</div><div style>And I've never heard of a major title that uses smart pointers, and assigns them around the place at runtime.</div>
<div style>I'm accustomed to memory management having a virtually zero cost at runtime.</div><div style>So I don't think it's biased at all (in the sense you say), I think I'm being quite reasonable.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Generally, I think what is needed for games is a concurrent GC. This incurs a memory usage overhead (floating garbage), and a tax on pointers write, but eliminate pause.<br></blockquote><div><br></div><div style>How much floating garbage? This might be acceptable... I don't know enough about it.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
That is a easy way to export a part of the load in another thread, improving concurrency in the application with little effort.<br></blockquote><div><br></div><div style>Are you saying a concurrent GC would operate exclusively in another thread? How does it scan the stack of all other threads?</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
With real time constraint, a memory overhead is better than a pause.</blockquote><div><br></div><div style>I wouldn't necessarily agree. Depends on the magnitude of each.</div><div style>What sort of magnitude are we talking?</div>
<div style>If you had 64mb of ram, and no virtual memory, would you be happy to sacrifice 20% of it? 5% of it?</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
One important detail to consider for realtime usage, is that it's very<br>
unconventional to allocate at runtime at all...<br>
Perhaps a couple of short lived temp buffers each frame, and the occasional<br>
change in resources as you progress through a world (which are probably not<br>
allocated in GC memory anyway).<br>
Surely the relatively high temporal consistency of the heap across cycles<br>
can be leveraged here somehow to help?<br>
</blockquote>
<br></div>
That is good because it means not a lot of floating garbage.<br>
</blockquote></div><br></div><div class="gmail_extra" style>Right. But what's the overhead of a scan process (that's almost entirely redundant work)?</div></div>