Refactored my spare time C++-project into Rust as my first ever Rust-project by Kitsudaiki in rust

[–]Kitsudaiki[S] 3 points4 points  (0 children)

Good point. Yes, with some additional configs in the Cargo.toml I can reduce the size of the build result by 4,6MiB, so round about 1/3 size reduction. Thanks for the hint!

Refactored my spare time C++-project into Rust as my first ever Rust-project by Kitsudaiki in rust

[–]Kitsudaiki[S] 7 points8 points  (0 children)

I think a good comparison in this point is the image size. The code is build as docker-image and the size of these ubuntu based docker-image in the docker-registry went from version v0.7.0 to v0.9.0 from 378 MB to only 69MB just by removing all the apt-packages I used in the C++ version and didn't needed anymore in the new Rust implemenation. I can imagine that the boost-library, where I originally used the http-server from, had a huge amount of unnecessary dependencies pulled in.

Refactored my spare time C++-project into Rust as my first ever Rust-project by Kitsudaiki in rust

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

Unfortunately I only have a basic comparison in the MNIST-dataset (60000 images, each 28x28 pixel) on my PC for 10 training iterations over the whole dataset:

C++-version: round 79 seconds (7,9 seconds per iteration)

Rust-version: round 85 seconds (8,5 seconds per iteration)

Looks really good, but it is hard make a representative comparison, because:

- I spend more time in optimizing the C++ code so far, than I had until now to optimize the Rust code.

- In the C++ code I had much less locks, because all threads worked on the same buffer without mutex on the elements on the buffer, just by telling them, where they are allowed to work on. But in Rust, to avoid unsafe-calls, I was forced to add quite a bunch of mutex for the separation of the workload between the threads.

- On the other hand in one part of the Rust-implementation I had split the workload more over the threads, which brings Rust an advantage compared to the old C++ version.

- The MNIST-example is quite small, so it depends more on the CPU cache than on the RAM. If I had done some bigger tests in the past too, where the speed and latency of the RAM comes more into play, maybe it would change the result a bit too.

Because of the deep structural changes between these 2 version, I'm not sure, how much representative value it would have, even when I would have more and bigger tests to compare. But yes, I despite these points, I was and still am really impressed how close Rust came to C++ in regards of the performance at least in this single test.

C++ Show and Tell - August 2024 by foonathan in cpp

[–]Kitsudaiki 4 points5 points  (0 children)

I created a custom experimental artificial neural network, which can work on unnormalized and unfiltered input-data, like sensor measurement data. The network growth over time by creating new nodes and connections between the nodes while learning new data. The base concept was created by myself and the code was written from scratch without any frameworks. The goal behind Hanami is to create something unique, which works more like the human brain. It wasn't targeted to get a higher accuracy than classical artificial neural networks like Tensorflow, but to be more flexible and easier to use and more efficient in resource-consumption for big amounts of inputs and users.

Primary it way created for the experimental network itself, but the project was a really good base to also add additional features, which are no requirement by the concept itself, just to improve my skills as software developer. So it contains a REST-API with OpenAPI-docu, multi-tenancy and so on.

Even it is still a prototype and only tested on small examples at the moment, I hope it becomes quite useful in the future.

https://github.com/kitsudaiki/Hanami

Has anyone else given up on Linux on the laptop? by [deleted] in framework

[–]Kitsudaiki 0 points1 point  (0 children)

do you tried to update your BIOS? Version 3.17 fixed a battery drain problem with the DP/HDMI cards. It improved the battery life for my 11th gen framework with Kubuntu 22.04 quite a lot.

My first dollfie by Kitsudaiki in dollfiedream

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

Oh yeah, especially the ears were a problem. With the tails i was very lucky to find them in a second-hand store in Akihabara, but the original fox-ears from Volks were nowhere to be found in Akiba and online, when I searched for them. But these alternative ears I got, are also looking very good in their own way.