Releases: austinksmith/Hamsters.js
Hamsters.js v5.5.8 Released!
I'm happy to announce the release of version 5.5.8 of Hamsters.js, this release changes how transferable objects are handled and will now make use of transferable objects in all scenarios where a transferable data type is being sent. Previously only typed arrays were being sent using transferable objects now it can be any of the following.
const typedArrayTypes = [
'Int32Array', 'Uint8Array', 'Uint8ClampedArray', 'Int16Array',
'Uint16Array', 'Uint32Array', 'Float32Array', 'Float64Array'
];
const otherTransferables = [
'ArrayBuffer', 'MessagePort', 'ImageBitmap', 'OffscreenCanvas'
];
Future releases will expand on this to allow you to handle these as responses better.
Enjoy!
Hamsters v5.5.7 Released!
This release is a hotfix release and patches support for using SharedArray buffers and not also passing array in your params object.
Hamsters v5.5.6 Released!
We're happy to release version 5.5.6 of Hamsters.js, this release fixes a bug when mixedOutput: true is passed in the params object and also cleans up the library architecture a little by moving hamsters.js tasks into their own class for creation. As well as some improvements to the memoization store, now its a LRU cache with a maximum of 100 entries in the database preventing memory usage from growing infinitely.
See the list below.
Bug Fixes
- Fixed issues where final outputs would be erroneous when mixedOutput: true passed in params
Improvements
- Moved hamstersjs task creation from being a simple in memory object to being a full fledged class
- Memoization store is now a Least Recently Used Cache, with a max of 100 database entries
Hamsters v5.5.5 Released!
We're happy to release version 5.5.5 of Hamsters.js, this release builds fixes several issues and brings back a new feature that was part of Hamsters.js early days.
See the list below.
Bug Fixes
- Pool is undefined error when tasks get queued for processing
- In situations where the thread pool is maxed out, a new thread will not spawn
- Library not starting in Node.js in some instances
Features
- Memoization, cache the results of your Hamsters.js functions. You can read more about how to use the new memoize feature here
Hamsters v5.5.4 Released!
We're happy to release version 5.5.3 of Hamsters.js, this release builds upon the newly introduced support for Atomic Operations in version 5.5.3 , this is an additional performance optimization that eliminates the overhead of passing the sharedArray to each thread.
In testing this resulted in a performance improvement of between 3.15% to 8.63% , depending on the number of threads being used.
Tested running the Atomic Operations Example with a million integers, comparing v5.5.3 to v5.5.4 using an Ubuntu 22.04 LTS 64-bit test machine with a Core i5-8300H 2.3ghz 4 cores 8 threads, 16GB DDR4 2400mhz dual channel.
Additionally the README and Hamsters.js Wiki have been updated with new information on making use of Atomics!
Hamsters v5.5.3 Released!
We're happy to release version 5.5.3 of Hamsters.js, this release brings the very long coming support for Atomic Operations, allowing us to completely eliminate the majority of thread communication overhead improving performance significantly.
We are in the process of updating the wiki documentation for this new feature, When running the new benchmark and comparing the results to our Collatz Conjecture example without SharedArrays, and our Atomic Operations Example which uses SharedArrays && Atomic Operations, we can see performance increases in the table below. The following results were taken on a Core i5 8300H 2.3ghz 4c/8t processor, 16GB of DDR4 2400mhz dual channel, running on Ubuntu 22.04 LTS
FireFox 126.0.1 (64-bit) -
Number of Threads | Time Taken (Result Set 1 - No SharedArrays) | Time Taken (Result Set 2 - SharedArrays) | Time Difference (ms) | % Performance Increase |
---|---|---|---|---|
1 | 9,908ms | 9,421.54ms | 486.46ms | 4.91% |
2 | 5,962ms | 5,302.82ms | 659.18ms | 11.06% |
3 | 4,637ms | 3,830.7ms | 806.3ms | 17.39% |
4 | 4,302ms | 4,118.26ms | 183.74ms | 4.27% |
5 | 3,489ms | 3,828.34ms | -339.34ms | -9.73% |
6 | 3,514ms | 3,576.22ms | -62.22ms | -1.77% |
7 | 3,367ms | 3,104.14ms | 262.86ms | 7.81% |
8 | 3,302ms | 3,098.24ms | 203.76ms | 6.17% |
Average | 5,060.13ms | 4,660.16ms | 399.97ms | 8.24% |
Brave v1.66.118 -
Number of Threads | Time Taken (Result Set 1 - No SharedArrays) | Time Taken (Result Set 2 - SharedArrays) | Time Difference (ms) | % Performance Increase |
---|---|---|---|---|
1 | 66,725ms | 58,918ms | 7,807ms | 11.70% |
2 | 37,278ms | 32,366ms | 4,912ms | 13.18% |
3 | 27,766ms | 23,642ms | 4,124ms | 14.85% |
4 | 23,445ms | 19,418ms | 4,027ms | 17.18% |
5 | 22,886ms | 21,160ms | 1,726ms | 7.54% |
6 | 22,344ms | 19,723ms | 2,621ms | 11.73% |
7 | 24,496ms | 18,582ms | 5,914ms | 24.14% |
8 | 22,486ms | 18,965ms | 3,521ms | 15.66% |
Average | 30,928.75ms | 26,471.63ms | 4,457.13ms | 14.50% |
Enjoy!
Hamsters v5.5.2 Released!
We're happy to release version 5.5.2 of Hamsters.js, this release is aimed at performance and provides some gains for tasks that use only a single thread with a percentage improvement is approximately 21.4% in benchmarks.
- Removed unnecessary if statement and return during runtime - improves performance in all scenarios
- Removed expensive indexe's calculation from function calls that use only 1 function, improves performance for single threaded tasks
- Refined task object creation for better performance and removing unnecessary checks
Enjoy!
Hamsters v5.5.1 Released!
We're happy to release version 5.5.1 of Hamsters.js, this is more of a hotpatch than a release, it just builds upon v5.5.0
- This is a simple bug fix that restores the typedArrayFromBuffer method that was previously removed in version v5.4.3
Enjoy!
Hamsters v5.5.0 Released!
We're happy to announce the release of version 5.5.0 of Hamsters.js this release brings some improvements to the library performance and architecture and a new optional parameter for functions that have outputs of different sizes than their inputs. Here are the list of changes below!
- Refactored library initialization to reduce library memory usage before initialization and improve performance
- Completely eliminated passing of library variables between functions, improves performance
- Added new optional parameter called
mixedOutput: Boolean
you can pass true or false to this. Its recommended not to use this unless you needed as it can reduce performance slightly. - Refactored library classes to match JavaScript class naming conventions
Enjoy!
Hamsters v5.4.4 Released!
This release resolves a few issues that will increase overall performance however it comes at a cost of higher memory usage
Resolved index calculation to support odd numbers of threads such as triple core processors
Added more unit tests
Resolved some unit tests not working in Firefox browser
Added task.output for output data, previously the library was modifying the input array as the output, this was great from a memory usage standpoint however its bad practice to modify inputs so that's no longer happening.
Cleaned up code some
Enjoy!