Square Root Example

This example is designed to give an idea on how performance can scale using Hamsters.js, you can play around with different test sizes to see how scaling changes with problem size.

This is what would be considered an embarrassingly parallel problem, the provided example will generate a random array containing the selected test size amount of randomly generated integers, and loop through the test data set multiple times, calculating the square root of every integer, and returning the results from each thread.

Each time the benchmark runs it will increase the number of threads used until reaching the number of logical threads detected. When the benchmark is complete, it should render a graph showing how much faster (or slower) the logic ran with each additional thread.

Client Summary

  • Hamsters.js Version:
  • Maximum Threads:
  • Browser:
  • Legacy Mode:
  • Atomic Operations Support:
  • Transferable Object Support:

Test Size

Random Integers

Execution Time - Lower is better

Thread Scaling % Improvement - Higher is better