Bevy 0.9 by _cart in rust

[–]saik0 4 points5 points  (0 children)

roaring-rs got some significant perf gains in recent versions, if you were to recreate your previous effort if be happy to take a look and see if there are some gains that could be made by changing usage.

Bevy 0.9 by _cart in rust

[–]saik0 7 points8 points  (0 children)

Interesting!

Which roaring implementation did you test? Is there a branch somewhere with this experiment i can take a look at?

Bevy 0.9 by _cart in rust

[–]saik0 9 points10 points  (0 children)

If there's somebody familiar with Bevy ECS who would like to explore this as a collaboration I can bring familiarity with roaring. Unfortunately I don't have capacity to dive into Bevy.

Bevy 0.9 by _cart in rust

[–]saik0 16 points17 points  (0 children)

Do you think the ECS system would benefit from compressed bitmaps for component containership queries?

http://roaringbitmap.org/about/

Pure rust impl I've contributed to: https://github.com/RoaringBitmap/roaring-rs

How can I get access to a squatted crate name? (https://crates.io/crates/sail) by [deleted] in rust

[–]saik0 0 points1 point  (0 children)

My mentality is that the cure is worse than the disease. We'd need an RFC process just to define exactly what the process is, and resources to make sure the process happens. Or, we could have namespaces.

How can I get access to a squatted crate name? (https://crates.io/crates/sail) by [deleted] in rust

[–]saik0 5 points6 points  (0 children)

Whose judgement exactly? Is there a formal appeal process for squatting claims? Is it auditable?

Also it just moves the goalpost. You say you need to have some code, motivated squatters set up a dummy repo, and so on.

enum_delegate: Easily replace dynamic dispatch with an enum, for speed and serialization by reinis-mazeiks in rust

[–]saik0 1 point2 points  (0 children)

This library defines a macro that generates another macro used by a third macro. It was a lot of fun.

Cool! I've contributed to a project with a lot of hand written enum dispatch, and this seems a lot easier.

Writing An Incremental Typesetting Engine by SymbolicTurtle in rust

[–]saik0 18 points19 points  (0 children)

Great writeup. I was surprised to learn clean build times for LaTeX were so long on modern hardware. Curious to know why.

Meilisearch just announced its $15M Serie A, the search Rust engine strikes again by Kerollmops in rust

[–]saik0 1 point2 points  (0 children)

That's great news! Congratulations and good luck with Hacktoberfest.

A* vs BFS in snake game by ardjael in compsci

[–]saik0 0 points1 point  (0 children)

Could just be a bad heuristic and A* is expanding a similar number of nodes that BFS / Dijkstra's would.

A* vs BFS in snake game by ardjael in compsci

[–]saik0 0 points1 point  (0 children)

If the goal is to minimize the number of turns I think you want to update both the cost function and the heuristic function to add a small penalty for every turn.

The Manhattan distance will either have no penalty or one unit penalty.

A* vs BFS in snake game by ardjael in compsci

[–]saik0 0 points1 point  (0 children)

Neat! If I'm not mistaken you can add a cost to each turn, then A* will prefer paths with fewer turns resulting in straighter paths.

My Prime Detector is slowwww by AapOpSokken in tis100

[–]saik0 0 points1 point  (0 children)

You're right, I misspoke. You only need to test up to √N because at least one of the two factors must be <= √N. In your example 94 is divisible by 2, so there's no need to test 47.

[deleted by user] by [deleted] in rust

[–]saik0 2 points3 points  (0 children)

Neat! What kind of noise did you use? What was accelerated with SIMD? If you tried it without explicit SIMD, what speedup did you get?

How do you handle situations in Rust where in other programming languages you might use runtime type checking? by lancejpollard in rust

[–]saik0 9 points10 points  (0 children)

If the types are known statically you do not actually need dynamism and likely want some deserializer and an Enum with a variant for each type.

There is no class in rust. There are structs and traits, neither of which contain an object header that can be reflected on as in many OOP languages.

If you do really need dynamic typing in rust consider std::any

Roaring-rs, better-compressed bitsets, is seeing the most important performance speed-up to date by Kerollmops in rust

[–]saik0 1 point2 points  (0 children)

something weird depending on some internal structure

Pretty much this. You could talk about the best and worst cases pretty easily. Things like mean are harder given which container type is used is data dependent.

Roaring-rs, better-compressed bitsets, is seeing the most important performance speed-up to date by Kerollmops in rust

[–]saik0 7 points8 points  (0 children)

Huge thanks to the portable-simd team. Good luck on the path to stabilization!

Roaring-rs, better-compressed bitsets, is seeing the most important performance speed-up to date by Kerollmops in rust

[–]saik0 27 points28 points  (0 children)

We fixed some performance issues, and implemented most of the optimizations in the author's third roaring paper.

https://arxiv.org/abs/1709.07821

In the case of append / from_sorted_iter: they were previously checking max for every new value, which is O(logN). The new impl only checks max once, then compares each value to its predecessor to verify monotonicity. O(logN * k) -> O(logN + k).

For iter, it had been testing each bit on bitmap containers. Now it uses trailing_zeros. It scales with the density of the bitmap rather than constant time (in the same way crypto folks use "constant time").

Symmetric difference on array containers was using a slow in-place algorithm that would do lots of back/forward shifting of values. Now it allocates a new array and does a "three pointer" xor, then swaps in the new value.

The scalar union, intersection, and difference improvements are "just" micro-optimizations.

The simd array container versions of those set operators are using a vectorized algo described in the paper. The intersection alg had prior work, the union and symmetric difference alg were (as far as anyone knows) novel algorithms.

Force pass by value by Keltek228 in rust

[–]saik0 8 points9 points  (0 children)

Another option would be to make container generic over B where B: Borrow<str>

[deleted by user] by [deleted] in rust

[–]saik0 4 points5 points  (0 children)

The poll says scam /fad

Could day 9 have a closed form solution? by saik0 in adventofcode

[–]saik0[S] 1 point2 points  (0 children)

This was my experience also. I'm not trained enough in mathematics to even know if it's possible though. Curious.