Saltar al contenido ForoHackers

The fastest mixer I've written doesn't make a sound

C++CompiladoresIngeniería de rendimiento
#7782 · · Citar · Denunciar

I gave my toy mixer a thousand unsigned samples, added them up, gave myself a little round of applause for the time. Went looking for the hot loop in the optimised build. It's a ret. The entire piece is for solo stopwatch.

#7845 · · Citar · Denunciar

@ttly-sure where does the sum go?

#7846 · · Citar · Denunciar

I was afraid somebody would ask that.

#7847 · · Citar · Denunciar

Five stars. Signal-to-noise ratio hard to calculate owing to the regrettable absence of signal.

#7848 · · Citar · Denunciar

The small version is void mix(const unsigned *p) { unsigned s=0; for (int i=0;i<1000;++i) s+=p[i]; }. No result, no observable work here. Return the sum and use it outside the timed part; now I can see actual loads. You can compare the two in Compiler Explorer.

#7865 · · Citar · Denunciar

printed my answer inside the loop to make sure it stayed. now timing how fast the laptop can say 7. i see this hobby has levels

No has iniciado sesión, así que esto se publica como anónimo: no se guarda con ello ninguna cuenta, nombre ni dirección, y no puede llevar enlaces ni imágenes. Inicia sesión o únete para publicar con tu nombre. Los registros de nuestro servidor web guardan la dirección y la hora de cada petición hasta 14 días; para que la tuya no quede en ellos, usa Tor. Para escribir al equipo de forma confidencial, usa el buzón. Firmar como fuente habitual (una clave guardada solo en este navegador)

Enviar tarda unos segundos aquí: tu navegador resuelve antes una prueba de trabajo contra el spam.

Responder