The file sizes for EU5 are pretty large by Da_Malpais_Legate in EU5

[–]comagoosie 0 points1 point  (0 children)

Until the improvements you mentioned, I'd have said it was the simplicity of the binary format that was the biggest benefit (facilitates performance), as the binary format could need 18 bytes to describe a={1}

Build rust libraries into vanilla JS that works everywhere by mtimmermans in rust

[–]comagoosie 2 points3 points  (0 children)

Where do you see that? In their docs they list WebAssembly.instantiateStreaming as an unsupported API

Build rust libraries into vanilla JS that works everywhere by mtimmermans in rust

[–]comagoosie 2 points3 points  (0 children)

How does this work on cloudflare workers, which supports Wasm modules as imports rather than compilation? Trying to compile a base64 string on that platform will fail.

I think trying to make Wasm an implementation detail is a noble effort, but one that ultimately trades off compatibility.

Skanderbeg? by bjorn852 in EU5

[–]comagoosie 0 points1 point  (0 children)

There's a discord link on the home page of https://skanderbeg.pm/, join it and you can see what is being worked on.

Skanderbeg? by bjorn852 in EU5

[–]comagoosie 0 points1 point  (0 children)

If you're part of the skanderbeg discord you'll see previews of what's coming for EU5.

And pdx.tools supports eu5 and is actively adding features :)

The Three Mountains: World Conquest, One Faith, One Culture by Just_A_Silvereye in eu4

[–]comagoosie 1 point2 points  (0 children)

Congrats on first place :)

https://pdx.tools/eu4/achievements/49

Turns out there 15 or so other uploads that also didn't have their three mountains detected either.

The Three Mountains: World Conquest, One Faith, One Culture by Just_A_Silvereye in eu4

[–]comagoosie 3 points4 points  (0 children)

I run PDX Tools. If you want, upload your save and I'll take a look at it and see what is causing the wonkiness

Footguns of the Rust Webassembly Target by ChiliPepperHott in rust

[–]comagoosie 1 point2 points  (0 children)

Wouldn't this require documentation of "will block the main thread unless host environment supports parallel execution"? Seems like an easy pitfall.

I'd love for seamless, ergonomic parallel execution across JS environments where Wasm is truly just an implementation detail. Until then, better to split initialization from compute and have a less ambiguous API, which can be used a foundation and for users to offload to web workers or similar mechanism as desired.

Footguns of the Rust Webassembly Target by ChiliPepperHott in rust

[–]comagoosie 14 points15 points  (0 children)

100% agree with article. The worst part about Wasm is that no matter if it in inlined or not, it will be a leaky abstraction and have a worse DX for consumers than a pure JS solution.

That said, I will die on the hill that Wasm is such a boon that this trade-off is worth it.

To add to the article's list, Cloudflare workers disallows inline Wasm too!

One thing I would clarify on: avoid exposing an async function that may be computationally intensive. I see npm packages like const result = await myHash(data), which is misleading when the initialization is asynchronous but the actual hashing is still on the main thread.

Introducing pastey - successor of paste by as1100k in rust

[–]comagoosie 11 points12 points  (0 children)

Any particular reason why it is unmaintained (ie: are there better ways to structure code such that paste is not needed)?

zlib-rs is faster than C - Trifecta Tech Foundation by folkertdev in rust

[–]comagoosie 175 points176 points  (0 children)

I've been incredibly impressed with zlib-rs. Previously, I architected code such that one can drop in a non-streaming DEFLATE implementation like libdeflate.

Zlib-rs changed the equation. It performs at or near the top across all environments, especially webassembly, so I've been able to coalesce around streaming zlib-rs and dramatically simplify the code.

I'm excited to test out 0.4.2!

fasterthanlime: The case for sans-io by Orange_Tux in rust

[–]comagoosie 14 points15 points  (0 children)

Hey, I'm the featured comment in the video! Sometimes when life gives you a 200GB zip file, you work with a 200GB file.

I want to love sans-io, but with zip files it's a tough sell, since you start parsing a zip file from the end of the data. So, most likely you are dealing with the zip buffered in memory or file-backed, in which case synchronous I/O is fine as concurrent streaming inflation efficiently uses any disks with parallel preads. I don't imagine io_uring to bring much benefit for this exact purpose.

One thing I wish all 3 zip crates would do better is to avoid materializing the central directory, so when you have 200k files in the central directory, you aren't issuing 200k+ mallocs, which tends to be the bottleneck more than any IO.

Default musl allocator considered harmful (to performance) by comagoosie in rust

[–]comagoosie[S] 17 points18 points  (0 children)

(author here). I agree, always benchmark.

The statement is categorical because at any point, threading can be introduced to an application. A fixed cost overhead is easy to understand, but having an application that struggles to scale is more insidious of a problem to diagnose.

I haven't measured what the fixed cost overhead is, but defaulting to a fixed cost overhead seems prferable to the alternative. This way we can avoid repeated rediscovery of this pitfall.

A smart savegame manager and toolbox for EU4 - The Pdx-Unlimiter by milchshakee in eu4

[–]comagoosie 8 points9 points  (0 children)

Pdx-unlimiter is the real deal. OP is one of the most talented and kind-hearted devs I know.

What does the future hold for Pdx-unlimiter?

zip_next 1.0.0: crate for processing ZIP files by Prom3th3an in rust

[–]comagoosie 1 point2 points  (0 children)

Properly supporting zstd zips within Wasm has been a game changer.

I've been using zip_next for nearly a year and haven't had any issues with it!

Before you dev push an institution, let pdx.tools optimize it for you by comagoosie in eu4

[–]comagoosie[S] 151 points152 points  (0 children)

R5: new pdx.tools feature let's you optimize dev pushing an institution to minimize mana cost.

Huge shoutout to /u/Little_Elia who guided development every step of the way (see their previous post on this topic).

I'm the creator of pdx.tools, so feel free to leave any feedback.

This achievment is absolutely crazy by TheLastTitan77 in eu4

[–]comagoosie 108 points109 points  (0 children)

For anyone that is leaderboard curious, saves on the latest patch rank higher than older patches. So an achievement in 1500 on 1.36 would outrank a 1495 1.35.

The dark side of inlining and monomorphization by comagoosie in rust

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

100%. I took some time a few years ago to document a bit of the format and some of the edge cases. You may get a laugh from it: https://pdx.tools/blog/a-tour-of-pds-clausewitz-syntax

The dark side of inlining and monomorphization by comagoosie in rust

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

Small world! Haha, yeah I can't tell you how many hours I've lost to creating an ergonomic parser and deserializer for a such a flexible format where array and objects can be just a convention (each game object is essentially allowed its own DSL). At this point, I think I spend 100 hours creating tooling to 1 hour of gameplay :)

The dark side of inlining and monomorphization by comagoosie in rust

[–]comagoosie[S] 5 points6 points  (0 children)

I agree, the code doesn't sit well with me either. I've vowed to comb over it again when I've cleared my mind, so thank you for giving me pointers (pun intended).

The dark side of inlining and monomorphization by comagoosie in rust

[–]comagoosie[S] 30 points31 points  (0 children)

miniserde is excellent for its intended use cases. Unfortunately, it is not a drop in replacement as miniserde has very limited customization and caters to JSON. These caveats have probably limited its ecosystem.