Saltar al contenido

KG.cxx 💻

@aikathg.bsky.social did:plc:tmyif2lansps6apqfgleo4rc

Humano semi-funcional. As vezes posto coisas sobre programação, matemática, xadrez, músicas japonesas, etc. Coshuler, curso técnico em Informática e estudante de CC 🏳️‍🌈🏳️‍⚧️

En Bluesky desde el

Seguidores
196
Siguiendo
136
Posts
1.340
Días en rankings
0

Resumen

KG.cxx 💻 (@aikathg.bsky.social) es un usuario de Bluesky que se unió el 29 agosto 2024. Tiene 196 seguidores, sigue a 136 cuentas y ha publicado 1.340 posts.

Apariciones en rankings

Los mejores días en que los posts de esta cuenta entraron en la lista diaria de Debya.

Esta cuenta aún no ha aparecido en un ranking diario.

Posts que le gustaron recientemente

Me gusta públicos de la red Bluesky.

  • Andrew J. Bromage@pseudonym73.bsky.social

    For the array search part, don't forget that vector instructions exist these days. With SSE2, for example, you can do four 32-bit float comparisons in parallel, _mm_movemask to put the result in an integer register, then bsr/bsf on that. ARM Neon has all this too.

    Ver post
  • Andrew J. Bromage@pseudonym73.bsky.social

    If you have a lot of floats and you need to binary search, you can use this variant: unsigned logl = ceil_log_2(y.size()); int i = 0; for (unsigned k = 1 << (logl-1); k > 4; k >>= 1) { int t = i + k; if (yt >= y[t]) i = t; // Conditional move instruction }

    Ver post
  • Andrew J. Bromage@pseudonym73.bsky.social

    After this, i is now pointing at an aligned subsequence of four floats that you can do the vector comparison trick on. This is the fastest way I've found to do this kind of search on modern hardware, assuming that you can't exploit the distribution of y somehow (e.g. bucketing).

    Ver post
  • Jeff Silksong Coelho@jeffquesado.ulivre.dev

    Unfortunately I guess there is none. Perhaps a binary search can help, but I can't think of a O(1) algorithm

    Ver post
  • Calle Svensson@zetatwo.bsky.social

    I think this is a very sound approach. The rule of thumb I got from my friend who builds fuzzers is that for lists up to ~1000 elements, the fastest thing you can do is a linear search so a good initial guess plus that sounds optimal.

    Ver post

Inicia sesión para ver más

Cuentas que bloquea

En Bluesky los bloqueos son registros públicos.