Войти в систему

Home
    - Создать дневник
    - Написать в дневник
       - Подробный режим

LJ.Rossia.org
    - Новости сайта
    - Общие настройки
    - Sitemap
    - Оплата
    - ljr-fif

Редактировать...
    - Настройки
    - Список друзей
    - Дневник
    - Картинки
    - Пароль
    - Вид дневника

Сообщества

Настроить S2

Помощь
    - Забыли пароль?
    - FAQ
    - Тех. поддержка



Пишет nancygold ([info]nancygold)
@ 2024-07-26 23:43:00


Previous Entry  Add to memories!  Tell a Friend!  Next Entry
Настроение: amused
Entry tags:computing

Surprisingly replacing

INLINE uint64_t PRFX(NH_PFX,,Hash_)(uint64_t key) {
  key ^= key >> 33;
  key *= 0xff51afd7ed558ccd;
  key ^= key >> 33;
  key *= 0xc4ceb9fe1a85ec53;
  key ^= key >> 33;
  return key;
}

with
INLINE uint64_t PRFX(NH_PFX,,Hash_)(uint64_t key) {
  return (key ^ (key >> 33)) * 0xff51afd7ed558ccd;
}

Makes the code setting 2**32 bits 20% faster.
Counter intuitive, since every one recommends stronger hash functions.
Guess that is another "security expert" thingie.
Because some hacker can spam your hashmap with collisions.
Which never happens in reality, because nobody cares about my apps.
Lesson learned: pay no attention to retards, especially renowned PhD retards.


(Добавить комментарий)


[info]necax
2024-07-27 00:30 (ссылка)
20% is a microoptimization tier gain anyway

(Ответить) (Ветвь дискуссии)


[info]nancygold
2024-07-27 00:55 (ссылка)
48 FPS vs 60 FPS

(Ответить) (Уровень выше)


(Анонимно)
2024-07-27 00:53 (ссылка)
>since every one recommends stronger hash functions

in the security conscious setting. In the langauge standard library for high security defaults setting. Not in the game development setting. Nobody will use your language and nobody will attempt to hack through it, so making anything approaching crypto hashes is just idiotic.

(Ответить) (Ветвь дискуссии)


[info]nancygold
2024-07-27 00:56 (ссылка)
Exactly! Security is overrated.
But niggers will keep promoting it everywhere.
SSL was the worst thing happening to Internet.

(Ответить) (Уровень выше) (Ветвь дискуссии)


(Анонимно)
2024-07-27 01:09 (ссылка)
>SSL was the worst

Highly useful against non-technical neighbors trying to dig through your shit, and non-state actors in general.

(Ответить) (Уровень выше)


(Анонимно)
2024-07-27 01:08 (ссылка)
Btw, what's the level of compression you achieve with your bitmap thingie right now? Does it perform well with simulated data vs simple byte array approach already?

(Ответить) (Ветвь дискуссии)


[info]nancygold
2024-07-27 01:28 (ссылка)
It can handle a few millions entities in real-time.
And it is fast enough to do set intersections and unions.
These are most common operations in a game.
And attaching tags to objects is common too.
Relations like `A loves B` are also tags.
I.e. A is in a set of objects that love B.
In any case, order of magnitude better than what I had before.
That is, I used all 64 bits to store just a single bit.
Symta exposes it as a generic hashmap.
And it is auto promoted to a normal hashmap,
As soon as one of the value is not 1 (0 = No value).
Think https://en.wikipedia.org/wiki/Numerical_tower
But for hash maps.
Bitmap is the most basic of these.

(Ответить) (Уровень выше)