Freelancer needed for a function (pay $80)

Hello everyone!

I’m looking for one freelancer to help me with a small function in Rust.
i’m paying $80, it’s about 20 lines of code.

PM me if interested.
For moderators, sorry if it’s the wrong section, didn’t know where to post.

Thank you.

Hello! Welcome to the Rust Users Forum.

What kind of function is this? If it’s something like an implementation of a sorting algorithm, alot of people here would be fine with helping on that, but if it’s working with proprietary (Non-releasable) code, then a public forum is not the place to go for help of this kind.

1 Like

I’m tied up with an NDA which is why :slight_smile:
It’s mostly sorting yeah.

Well, the best I can offer is browsing what the community has to offer in regards to libraries that sort things, but there are alot of different kinds of sorting adapters, algorithms, etc. These can be browsed under
But a very specific algorithm would probably need some more specialized work than a public library (IE, an algorithm for sorting specific patterns in some data)

1 Like

Can you tell us what you can, for example, what data structure you are trying to sort or what are the performance requirements?


Thank you guys!

i’ve annoymized some of the functions.

type Key = [u8; 32];

type Data = Vec<[u8; 32]>;

struct Value {
    data: Data,
    // other fields...

fn extract(map: BTreeMap<Key, Value>) -> Vec<[u8; 32]> {
        .flat_map(|(_, v)|

Is that the fastest I can do? (it’s using rayon)

So you want to get the values out of a BTreeMap? Do you need to collect them, could you just return the iterator instead of collecting them?

The values are in the Vec in each Struct.

Is your input always a BTreeMap?

Yeah, It’s always a BTreemap, about 20M keys and 10 entries in each value (in the Vec)

Then this is probably the fastest you will get it. Based on what we can see.

Ok, was about the Vec, I tried replacing it with SmallVec but I can’t make it work with Rayon :confused:

SmallVec inside the BTreeMap? You can use rayon::iter::ParallelBridge to convert from a normal Iterator into a ParallelIterator.

use rayon::iter::ParallelBridge;
        .flat_map(|(_, v)|

That is smarter to use SmallVec (about 10 values) inside the Vec?

Yes, you can use SmallVec, this will prevent allocations if you select your buffer carefully. With 20M elements, this is probably good.

1 Like

Awesome! Thanks for the help

1 Like

No problem

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.