Svenskunganka

Joined 11 years ago

Karma
1,162
Submissions
209
Member since
Mar 9
View on Hacker News

Recent submissions

Comment · 1 year ago
Perhaps I'm misunderstanding you, but Dioxus does not use the canvas when rendering in the browser. It uses the DOM with CSS just like any other JavaScript framework does.
Comment · 1 year ago
The whole paper is not only full of misunderstandings, it is full of errors and contradictions with the implementations.

- Rust is run in debug mode, by omitting the --release flag. This is a very basic mistake.

- Some implementations is logging to stdout on each message, which will lead to a lot of noise not only due to the overhead of doing so, but also due to lock contention for multi-threaded benchmarks.

- It states that the Go implementation is blocking and single-threaded, while it in fact is non-blocking and multi-threaded (concurrent).

- It implies the Rust implementation is not multi-threaded, while it in fact is because the implementation spawns a thread per connection. On that note, why not use an async websocket library for Rust instead? They're used much more.

- Gives VM-based languages zero time to warm up, giving them very little chance to do one of their jobs; runtime optimizations.

- It is not benchmarking websocket implementations specifically, it is benchmarking websocket implementations, JSON serialization and stdout logging all at once. This adds so much noise to the result that the result should be considered entirely invalid.

> To me, the champion is uWebSocket. That's the entire reason why "Node" wins [...]

A big part of why Node wins is because its implementation is not logging to stdout on each message like the other implementations do. Add a console.log in there and its performance tanks.

Comment · 2 years ago
Comment · 2 years ago
I started with the World Editor from Warcraft 3 around that age, creating custom maps, gamemodes and spells/abilities. It has scripting capabilities that is somewhere between GUI code and actual code. There's also a lovely community around the World Editor over on https://hiveworkshop.com. Picking the latest custom spell updated as a showcase, if you expand the "Spoiler: Triggers" you can see how the "code" looks like: https://www.hiveworkshop.com/threads/frost-field-v1-0-1.3556...

There are a lot of custom maps in that game that has later become their own standalone games, the most well-known is probably Dota 2 that is the successor to the DotA custom map in Warcraft 3. I hear the Warcraft 3: Reforged update brough Lua support, but the "old" way of using the GUI or JASS is still supported so there is a natural learning path from the simpler GUI code to more advanced JASS or Lua code.

Comment · 2 years ago
So far the comments here seem to think they are introducing generic ads in the client, while the ads the article describes is to allow game studios to offer virtual rewards (aka hats) in their games when you livestream your gameplay to other Discord users, and those users (viewers) will then be seeing ads while watching that gameplay. This is somewhat similar to the Twitch Bounty Board for streamers and "drops" for viewers. Discord calls this "Sponsored Quests", and seems very unobtrusive.
Comment · 3 years ago
I'm not the one who wrote the original comment, so I can't modify it. But one should still commit offsets because it is the happy-path; DB transaction successful? Commit offset. If the latter fails due to e.g application crash and you seek at startup to the partition offset stored in the DB + 1, you get exactly-once semantics. There's some more details, e.g you'd have to do the same during consumer group rebalance, and topic configuration also plays a role, for example if the topic is a compacted topic or not, and if you write tombstones, what its retention policy is.

edit: You added some more to your comment after I posted this one, so I'll try to cover them as well:

> One downside is that you leak internals of other system (partitions).

Yeah, sure.

> The other is that it implies serialised processing - you can't process anything in parallel as you have single index threshold that defines what has been and what has yet not been processed.

It doesn't imply serialised processing. It depends on the use-case, if each record in a topic has to be processed serially, you can't parallelize full-stop; number of partitions equals 1. But if each record can be individually processed you get parallelism equal to the number of partitions the topic has configured. You also achieve parallelism in the same way if only some records in a topic needs to be processed serially, at which point you can use the same key for the records needing to be serially processed and they will end up in the same partition, for example recording the coordinates of a plane - each plane can be processed in parallel, but an individual plane's coordinates need to be processed serially - just use the planes unique identifier as key and the coordinates for the same plane will be appended to the log of the same partition.

Comment · 3 years ago
Depending on how you use the database it is. If you write the data as well as the offset to the DB in the same transaction, you can then seek to the offset stored in the DB after application restart and continue from there.
Comment · 3 years ago
Comment · 3 years ago
Comment · 3 years ago
From my perspective they're not entirely equivalent. The async variant seems to be batching getImages and saveImages, while the sync variant gets and saves each image individually, sequentially.
Comment · 3 years ago
It's worth mentioning that there are some aspects of the virtual thread implementation that is important to take into consideration before switching out the os-thread-per-task executor for the virtual-thread-per-task executor:

1. Use of synchronized keyword can pin the virtual thread to the carrier thread, resulting in the carrier thread being blocked and unable to drive any other virtual threads. Recommendation is to refactor to use ReentrantLock. This may be solved in the future though.

2. Use of ThreadLocals should be reduced/avoided since they're local to the virtual thread and not the carrier threads, which could result in balooning memory usage with extensive usage from many virtual threads.

Comment · 3 years ago

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton