ID:2774733
 
This week has gone a little better than last week in most respects, particularly the sit-at-the-desk part, so I've been working on loose ends that have piled up in 515: mainly a lot of testing and documentation that needed doing.

Another item on my agenda has been to improve performance on some common tasks. I'm still on the fence about some kind of built-in proc for things like distances, e.g. a built-in sqrt(x*x + y*y + z*z + ...). But, I did add some interesting optimizations for those sorts of operations anyway. So now an operation like (a-b)*(a-b) only has to calculate a-b once, and likewise I've optimized x ** 2 with the same method. This comes up enough that I think it'll be a hidden benefit to some existing code, so it's one of those painless hidden optimizations.

I'm still perplexed by a bug that cropped up last week regarding world.Export(), and I don't have a good answer for it. My gut says the solution lies in revamping the code used for sleeping background procs that wait for an external event, since something inexplicable must be wrong with it. But, that's a project I don't feel comfortable taking on at this moment, so it'll have to wait. Anyway I have no means of reproducing the bug on my own right now.

Also on the to-do list is that one user has come up with a potential improvement for the checksum algorithm BYOND uses for cache files and various other things. I'm thrilled about that possibility, but I need to dissect the code in question and see how it can be converted to the existing environment. Apparently it makes some use of instructions I don't know the Linux compilation toolchain will support. (The Linux end has been a bottleneck to adopting a lot of cool newer C++ capabilities.)

Thanks to all of you who continue to support BYOND as Members and on our various donation platforms. It's much appreciated.

Spring is drawing near, which explains all the snow this week. At this point I'm wondering what fresh hell will keep me from a zoo day for the fifth year in a row, and that bingo card is looking mighty grim. We could all use a lot of cheering up. So if anyone's sitting on some top-tier cat videos or a clip of Amy Schumer getting heckled by a real comedian, this is your hour.
Lummox JR wrote:
We could all use a lot of cheering up.

https://www.youtube.com/watch?v=hY3A5I7m060

Lummox JR wrote:
Also on the to-do list is that one user has come up with a potential improvement for the checksum algorithm BYOND uses for cache files and various other things. I'm thrilled about that possibility

I went ahead and published v0.1.0 of libbyond. The first library is BYOND's peculiar CRC-32 checksum. In the future it might include other libraries; e.g. DMI, etc. I think this would be good for extension points in other languages such as Python.

It uses CMake which is almost ubiquitous in the C/C++ community and not that bad. I know you're not a fan, but it would certainly be easier for you to download CMake and generate your Visual Studio projects and Linux Makefiles than for me to download Visual Studio 2013 and create separate build systems for each platform.

but I need to dissect the code in question and see how it can be converted to the existing environment. Apparently it makes some use of instructions I don't know the Linux compilation toolchain will support. (The Linux end has been a bottleneck to adopting a lot of cool newer C++ capabilities.)

You mentioned that using C++'s standard library would be problematic for inclusion in BYOND, and I decided that I would rather not write non-idiomatic C++, so I went with C99 which should be supported by even your archaic GCC 4.4.7. (Dude, GCC stable is at 11.2.)

From the repo, here are some benchmarks from my MBP; baseline is my approximation of BYOND's current implementation and the number after each benchmark is the size of the input data.
----------------------------------------------------------------------------------------
Benchmark                              Time             CPU   Iterations UserCounters...
----------------------------------------------------------------------------------------
baseline/1000                       1.99 us         1.99 us       340179 bytes_per_second=480.356M/s
baseline/1000000                    1997 us         1997 us          346 bytes_per_second=477.661M/s
baseline/1000000000              2080410 us      2078082 us            1 bytes_per_second=458.92M/s
byond_crc32_update/1000            0.075 us        0.075 us      8197105 bytes_per_second=12.4825G/s
byond_crc32_update/1000000          50.7 us         50.6 us        14836 bytes_per_second=18.397G/s
byond_crc32_update/1000000000      88869 us        88651 us            6 bytes_per_second=10.5055G/s