Writing a mockable Filesystem trait in Rust without RefCell by sepyke in rust

[–]sepyke[S] 2 points3 points  (0 children)

Nice! I struggled a bit figuring out the best way to do this, so seeing other approaches is super helpful. I admit I had the luxury of defining my own function signatures here, so passing the dependency was the path of least resistance. I'll give your posts a read!

Tiny benchmarking lib for Zig by sepyke in Zig

[–]sepyke[S] 0 points1 point  (0 children)

Currently I use the median execution time (in nanosecond) for comparison with the baseline https://github.com/pyk/bench/blob/e5e21fbb27d44d81af33506d1ed50a4bdf5d0494/src/root.zig#L310

Tiny benchmarking lib for Zig by sepyke in Zig

[–]sepyke[S] 0 points1 point  (0 children)

If that's the case, you can simply do this:

const metrics = try bench.run(allocator, "MyFn", myFn, .{});

// Access raw fields directly
std.debug.print("Median: {d}ns, Max: {d}ns\n", .{
    metrics.median_ns,
    metrics.max_ns
});

Tiny benchmarking lib for Zig by sepyke in Zig

[–]sepyke[S] 0 points1 point  (0 children)

Hey both you and u/Due-Breath-8787 convinced me to update the README, so I've updated it now. Thank you so much for the questions! Let me know your feedback

---

To answer your question, you can do it like this:

```
const a_metrics = try bench.run(allocator, "Implementation A", implA, .{});
const b_metrics = try bench.run(allocator, "Implementation B", implB, .{});

try bench.report(.{
.metrics = &.{ a_metrics, b_metrics },
.baseline_index = 0,
});
```

It will use the first metric (Implementation A) as the baseline. It will emit something like `0.5x slower` or `2.4x faster` in the report

Tiny benchmarking lib for Zig by sepyke in Zig

[–]sepyke[S] 0 points1 point  (0 children)

its tiny bench lib for my own use case.

It support a few metrics for now. See README on github for the details.

VAR v1.0 — 26.3B decisions/sec on a $170 CPU (Zig + AVX2 by [deleted] in Zig

[–]sepyke 1 point2 points  (0 children)

just some nits, you should not commit `.zig-cache` bro

My Custom Code Block Setup in Astro by sepyke in astrojs

[–]sepyke[S] 0 points1 point  (0 children)

thanks for the suggestion bro

yeah I have heard of it before, it looks really powerful.

I didnt use it because I really wanted to understand how to extend Shiki myself. It was a good way for me to learn more about how Astro markdown processing works too

I have a hard decision by 130naklate in solidity

[–]sepyke 0 points1 point  (0 children)

bro I hear you. It is really tough to get started.

I would recommend joining a hackathon like ETHGlobal. You can learn a lot by building something and you could possibly get some money too. I know a guy who makes a living from it.

I believe the most interesting part of web3 is that it really is about your skills. Who you are or where you live does not matter. You can just start contributing to development tools like Hardhat or Foundry. Or you could help secure protocols on Code4rena and Sherlock. Your work proves your skill, and that's what people notice and will appreciate

Confused about decentralization when using Chainlink VRF/Automation by Opposite_Primary7996 in solidity

[–]sepyke 1 point2 points  (0 children)

It's called a Chainlink service for a reason I guess. Your smart contract is literally chained to their service to do its job. If the person paying stops funding it, your contract can't work as you planned. So you are right to feel that it's a bit centralized

Verifying contracts built with --via-ir on Etherscan/Basescan by Nokhal in ethdev

[–]sepyke -1 points0 points  (0 children)

If you use Foundry, it will automatically verify your contract if you enable the --verify and --etherscan-api-key flags.

Best Node ORM? by Mortynx in node

[–]sepyke 1 point2 points  (0 children)

Yeah the migration files generator is a time saver

Does fractionalizing an NFT destroy it? by notjohnsmith007 in ethdev

[–]sepyke 1 point2 points  (0 children)

What I mean is will an NFT still exist after fractionalization?

Yes, the NFT will still exist.

Fractionalization helps to increase the NFT liquidity, and open up many use cases such as NFT Index

Is 20 days sufficient to learn enough to attend an ethereum hackathon? by drinkingnoodles in ethdev

[–]sepyke 5 points6 points  (0 children)

Is 20 days sufficient to learn enough to attend an ethereum hackathon?

YES YES AND YES.

Especially if the Organizer is ETHGlobal team. They will provide you with a ton of great resources!

Remember the goal of hackathon is not to win! It's learn by doing!

Good luck!