A bottle of champaign to the person who explains

the speed improvement in dkong from 1230% to 1470% due to
this change (setting context->data to 0 in reset).
Actually, it will avoid the first stream_update of buffer_stream when
after approx. 11 samples the dac is written.
Without setting data to 0, stream_update(buffer_stream) is called before
stream_update(discrete_stream) is called.
With the patch, the order is of the stream_updates is determined by streams.c.

What makes this interesting is, that the startup order of the stream_updates
determines the whole run-time of the game. When profiling, NODE_73 (Sallen-Key-Filter)
needs 1066 cycles without the patch and under 135 with the patch, although it is the 4th node
after DISCRETE_INPUT_BUFFER.

All in all this looks like a caching issue, however I am currently clueless what in the end
is causing it.
This commit is contained in:
Couriersud 2009-10-11 17:32:38 +00:00
parent 04bad0addc
commit b971b59287

View File

@ -34,9 +34,9 @@ struct dss_adjustment_context
struct dss_input_context
{
stream_sample_t *ptr; /* current in ptr for stream */
UINT8 data; /* data written */
double gain; /* node gain */
double offset; /* node offset */
UINT8 data; /* data written */
UINT8 is_stream;
UINT8 is_buffered;
UINT32 stream_in_number;
@ -302,7 +302,7 @@ static DISCRETE_RESET(dss_input_stream)
struct dss_input_context *context = (struct dss_input_context *)node->context;
context->ptr = NULL;
//context->data = 0;
context->data = 0;
}
static DISCRETE_START(dss_input_stream)