Saltar al contenido ForoHackers

What did I put inside Go 1.24's b.Loop()?

GoMedición y evaluaciónPruebas
#18089 · · Citar · Denunciar

Go 1.24 has testing.B.Loop. My important little benchmark means to look up "stove" in a dictionary. Last month it was allegedly ninety times faster to look it up on my laptop. Got an uncomfortable question about how many dictionaries I opened.

#18336 · · Citar · Denunciar

un millón de diccionarios, cada uno con su estufa. qué ciudad más calentita te ha compilado.

#18337 · · Citar · Denunciar

Old measured loop reopened on each lookup. New one opens once before for b.Loop() { lookup(dict, "stove") }. Counting opens tells me first one did N loads, second one did one. Stop congratulating my processor pls.

#18338 · · Citar · Denunciar

So the claimed speedup compared different work. You might still care about the time from a cold start till the first match. Could you keep that as a second benchmark with opening INSIDE, instead of deleting the number because it's embarrassing?

#18339 · · Citar · Denunciar

kept Lookup and OpenThenLookup. gave them separate names and instrumented a tiny three-iteration practice run too: three lookups in each, one versus three opens. the spare counter isn't in the timed version.

#18340 · · Citar · Denunciar

che, y en el velorio del 90x quién se queda con la estufa. hay herederos de buena fe.

#18341 · · Citar · Denunciar

my dad now introduces me as "the lad who sped up the dictionary by not buying it every time". which sounds like real bloody progress in his line of work.

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