Skip to content

Hopscotch-JS is a memory access pattern micro-benchmark in JavaScript ported from the Hopscotch micro-benchmark suite

Notifications You must be signed in to change notification settings

nycu-sslab/hopscotch-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hopscotch-JS

Hopscotch-JS is used for the paper, "Offworker: An Offloading Framework for ParallelWeb Applications," authored by An-Chi Liu and Yi-Ping You.

Hopscotch-JS is a manually ported JavaScript version of the Hopscotch micro benchmark suite.

Currently, Hopscotch-JS's purpose is for evaluating the performance of the shared memory (SharedArrayBuffer) in parallel web workers, which tests different memory access patterns in a different number of web workers used upon the proxy pattern parallelism (the main thread creates a proxy thread and the proxy thread create other worker threads).

It's easy to modify the source code for a different purpose; for example, testing ArrayBuffer instead of SharedArrayBuffer, running the code without web workers, or not using the proxy pattern parallelism.

Setup

Node.js

Node.js is required. You can use NVM to install Node.js

# install nvm
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

# refresh shell
export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm

# install Node.js
nvm install node

# check Node.js
node -v

Chrome

Install chrome 91

# install chrome 91
wget http://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_91.0.4472.164-1_amd64.deb

sudo apt -y install ./google-chrome-...._amd64.deb
google-chrome-stable --version

Download the corresponding Chrome Driver.

helpful reading: https://unix.stackexchange.com/questions/233185/install-older-versions-of-google-chrome-stable-on-ubuntu-14-10

Usage

Open a web server for this project (listen on port 8081).

node tool/http_server.js

Install the node modules.

npm install

Run the benchmark.

# single run
node run_single.js

# batch run and store the output
node run_batch.js

Parameters

You can modify the parameters in benchmark/web_main_proxy.js:

{
    arr_len: 5000, // shared memory array length
    arr_num: 4,    // the amount of the shared memory arrays
    iter: 1000,    // iteration times
    thread_num: 4  // the number (<= 4) of thread used
}

Citation

If you use Hopscotch-JS for an academic purpose, please cite the followings:

  • Alif Ahmed and Kevin Skadron. 2019. Hopscotch: a micro-benchmark suite for memory performance evaluation. In Proceedings of the International Symposium on Memory Systems (MEMSYS '19). Association for Computing Machinery, New York, NY, USA, 167–172. https://doi.org/10.1145/3357526.3357574
  • An-Chi Liu and Yi-Ping You, "Offworker: An Offloading Framework for Parallel Web Applications," Proceedings of the 23rd International Conference on Web Information Systems and Engineering (WISE '22), Biarritz, France, October 31-November 3, 2022. [Online]. Available: https://doi.org/10.1007/978-3-031-20891-1_13
  • An-Chi Liu and Yi-Ping You, "Offworker: An Offloading Framework for Parallel Web Applications," M.S. thesis, Institute of Computer Science and Engineering, National Yang Ming Chiao Tung University, Hsinchu, Taiwan, 2022. [Online]. Available: https://etd.lib.nctu.edu.tw/cgi-bin/gs32/tugsweb.cgi?o=dnctucdr&s=id=%22GT0708560050%22.&switchlang=en

License

MIT

About

Hopscotch-JS is a memory access pattern micro-benchmark in JavaScript ported from the Hopscotch micro-benchmark suite

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published