Hamsters.js Versions Save

100% Vanilla Javascript Multithreading & Parallel Execution Library

v5.3.1

2 years ago

Hamsters.js v5.3.1 is officially live!

Latest Updates

  • Fixed all outstanding Node.js bugs including legacy fallback mode and Node.js native worker implementation support
  • Simplified initializing library logic to reduce startup time and memory allocation
  • Simplified main library logic to improve performance while library is running and reduce memory allocation
  • Refactored old logic to be cleaner
  • Removed explicit fallback support for Kindle3 Devices and Internet Explorer 10 Mobile Devices
  • Fixed bug reducing performance of transferable objects, massive performance gains observed
  • Reorganized library structure to improve maintainability
  • Initialization method no longer removed from library at startup
  • Now exposing internal habitat keys variable
  • Moved common folder outside core folder
  • Renamed common/rnHamsterWheel.js to common/reactNative.js
  • Created common/node.js file
  • Renamed /common/hamstersWheel.js to /common/internetExplorer.js

Enjoy!

Hamsters.js v5.3.1 is officially live

v5.2.1

2 years ago

Hamsters.js v5.2.1 is officially live!

Latest Updates

  • Fixed bug causing a console log to occur when creating threads and not using debug mode
  • Simplified initializing library logic to reduce startup time and memory allocation
  • Simplified main library logic to improve performance while library is running and reduce memory allocation
  • Refactored old logic to be cleaner
  • Fixed typo where transferrable should have been transferables
  • Applied security patches for development dependencies

Enjoy!

Hamster

v5.1.3

3 years ago

Hamsters.js v5.1.3 is officially live and includes some great fixes and optimizations

Bug Fixes

  • Resolved issues with Node.js on Windows not returning an output
  • Resolved performance limitations with transferrable objects

Improvements

  • Improved performance transferring data between main thread and threads
  • Added support for Node.js native worker implementation
  • Reduced the number of parameters used for internal logic

Enjoy!

Hamster

v5.1.2

5 years ago

Hamsters.js v5.1.2 is officially live and includes some great fixes and optimizations

Bug Fixes

  • Resolved issues with promises not working correctly
  • Resolved automatic environment detection inconsistencies
  • Resolved non-persistence mode not functioning correctly
  • Resolved some inconsistencies with thread pool and work queue system
  • Resolved a bug in the logger system when searching for saved log items
  • Resolved some bugs with legacy mode execution

Improvements

  • More extensive test cases and code coverage
  • Various changes throughout the logic including more strict/verbose variable checks
  • Cleaned up some redundant funtionality
  • Removed duplicated logic in various places
  • Reduced logic complexity & improved performance

Enjoy and have a happy holiday!

King Hamster

v5.1.1

6 years ago

With great excitement comes the announcement of version 5.1.1 of the Hamsters.js library, this release includes several fixes and general improvements.

  • Improved support for ReactNative, specifically included with the library is now a external worker scaffold file that is specially optimized for react-native-threads. This third party worker implementation is the most up to date available on npm at this point in time. Unfortunately it was discovered that this implementation only supports using strings to communicate with threads, the library will now ensure if using react native that only strings are used for communication, this will not result in the best possible performance but should ensure compliance with the ever changing react native landscape.

When making use off the library within reactNative, you must now copy the src/core/common folder to the root of your project directory.

  • Environment overrides, the library attempts to support as many devices and environments as possible, unfortunately sometimes automatic environment detection can fail causing the library to attempt to use unsupported features in a given environment. In order to prevent this from happening you can now override automatic environment detection and ensure the library operates in the mode designed for your environment.
    hamsters.init({
      'legacy', true/false
      'reactnative' : true/false,
      'browser':  true/false,
      'shell':  true/false
      'node':  true/false
    });
  • Import scripts, you can now instruct the library to import other libraries during execution by using the importScripts parameter, this synchronously loads the library into the workers execution context. You can read more about importScripts here. When making use of this feature you must pass a comma separated string to the library using a path relative to the workers execution context.
    var params = {
      importScripts: "foo.js"
    }
    hamsters.run(params.....

Lastly, some changes have been made to the build process to ensure the final library output is minified and optimized using the optimizeOrder plugin, if you have any new issues please report them as soon as possible, thanks!

Hamsters.js Javascript MultithreadingHamsters.js Javascript MultithreadingHamsters.js Javascript Multithreading

v5.0.0

6 years ago

v5.0.0

With great excitement comes version 5.0.0 of Hamsters.js, this version was a complete rewrite from the ground up with an emphasis on maintainability and bringing the library up to modern development standards. Now it's easier than ever to multithread your javascript!

Highlights

  • Completely rewritten from the ground up using ES6 classes
  • Adopted webpack
  • Abandoned bower support
  • Node.js now automatically detects available cores
  • Running npm run test actually works now
  • Resolved reactNative support
  • New searchable logging system (hamsters.logger)
  • Support for promise based execution

The main goals of this release was to get the library back to it's basics, Hamsters.js has always aimed to be a high/low level abstraction for parallel and threaded workloads. To that aim we no longer provide any out of the box abstractions or tools that are not required for library functionality, you will find that in hamsters 5.0.0 calling hamsters.tools will now be undefined.

A word with the open source community

Please consider supporting this project via our open collective, Hamsters.js has operated for the 3 years purely on out of pocket funding and the project does not want to abandon its open source aims in order to keep the lights on.

During the libraries time as an open source project we have needed to defend the project from copyright infringement and theft, my goals as the creator of this project was to give back to the JavaScript community and hopefully push the industry into making multithreading a more mainstream web application feature...after all whats the point of all these cores if we can't use them haha.

Almost immediately after publishing the library under the Artistic 2.0 license the library was cloned and all mentions of the source of the cloned project were removed giving the appearance that said user created an original from scratch project. This has happened on several occasions to varying degree over the past 3 years leaving me with a rather bad impression of the open source community as a whole, and again recently I was forced to spend over $1000 to stop a bad actor from blatantly infringing on the projects website and trade dress.

In the interest of full transparency a DMCA take down notice was issued through github to the offending repository and the host of the infringing website was contacted as well using a DMCA take down notice. This user persisted in the copyright infringement and moved web host a total of 7 different times using several methods to attempt to hide the host being used.

Ultimately after hiring a lawyer and contacting the user directly and sending a draft copy of a notice to file suit the offending party stopped the bad practices (for the time being), with these experiences it has proven to be costly both financially and mentally to continue to offer open source projects and support them. We need community support not only to continue to provide updates and support new hardware and features but also defend against these scenarios. - https://opencollective.com/hamstersjs/

Spectre & Meltdown

Part of the reason version 5 has been delayed is due to the discovery of the Meltdown and Spectre bugs, I had been working lately to change how the library operates so it can seamlessly support atomic operations behind the scenes. This would allow the library to dramatically reduce run time overhead and allow multiple threads to access a single shared array unfortunately right around the time I had hoped to release the new version it was announced these vulnerabilities existed in Intel X86 processors.

As a mitigation attempt all major browsers have since removed support for the most critical aspect of this functionality and that is the SharedArrayBuffer, this has had a major detrimental impact on the projects goals as I have waited a very long time for SharedArrayBuffer's to become mainstream only to have them removed due to security problems introduced by Intel.

Should SharedArrayBuffer support be brought back to browsers (unlikely at this point), then I will release a new version including them which will result in a major performance bump for the library.

Final Words

This release marks 3 years Hamsters.js has been in development, this project started out as me simply wanting to learn more about parallelism and multithreading since I had rarely made use of it in my software development career. I want to thank everyone who has supported the project and has given their recommendations on how to improve the library, the lessons I learned through the development of this project have been monumental and they won't soon be forgotten.

Be sure to checkout the updated https://www.hamsters.io/wiki for more information on how to get started with v5.0.0

ENJOY

v4.2.1

6 years ago

This release aims to resolve issues in extremely heavy workloads that can in rare situations cause out of memory errors in certain browsers before the garbage collector has been invoked.

The screen shot below is an allocation timeline using v4.2.0 note the retained size of the typed Int32Array where roughly 81% of the original array backing store was retained.

version 4-2-0

Since v4.2.1 now explicitly marks the params and rtn objects within a thread as undefined and ready for garbage collection we can see the results using the same test do not retain any of this data after execution.

version 4-2-1

Please report any performance degradation you encounter in comparison to v4.2.0 as this may cause the garbage collector to run more frequently than before though it should eliminate these out of memory errors moving forward.

v4.2.0

6 years ago

This release is targeted at decoupling the library logic into more easily logically separated pieces, future releases will expand on this more down the road with plans to offer more out of the box abstractions for tasks that can benefit from parallelism.

This release also includes many other general code improvements that should result in better performance and reduce the overall complexity of the library.

As this change also includes changes to the internal naming conventions of the library this release skips ahead from 4.1.4 all the way to 4.2.0 as it is a somewhat significant change, all logic written for previous releases should still be backwards compatible, please submit a bug ticket if you encounter any new issues.

v4.1.4

6 years ago

This release is another bug fix release that aims to resolve issues related to ReactNative support.

Resolved Issues

React Native Worker is undefined https://github.com/austinksmith/Hamsters.js/issues/35

Beta Features

This release also extends beta support for third party worker implementations on ReactNative, submit a ticket if you encounter an issue with a specific worker implementation.

v4.1.3

6 years ago

v4.1.3

This release is another bug fix release that aims to resolve outstanding issues related to Node.js third party WebWorker implementations.

Resolved Issues Worker is undefined under Node.js https://github.com/austinksmith/Hamsters.js/issues/27