Sable / dls18-ostrich

Experimental results for the second version of ostrich in the context of ubiquitous Javascript
3 stars 2 forks source link

Inside: hmm with Node.js on Ubuntu-deer #5

Open wukefe opened 6 years ago

wukefe commented 6 years ago

Experiments of hmm with Node.js on Ubuntu-deer

Two versions of node.js

Warmup: Performance Overview

Setup

Debugging the core part of hmm as follows:

// function 
    for (iter = 0; iter < iterations; iter++) {
Line 1:   new_log_lik = calc_alpha(a, b, pi);   //step 0
        if (new_log_lik == EXIT_ERROR) {
            return EXIT_ERROR;
        }
        ......  // comment out the rest of the code inside the loop body
    }

// function: calc_alpha
    for (t = 1; t < length; t++) {
Line 2:   mat_vec_mul( 'n', nstates, nstates, a, nstates, alpha, offset_prev, alpha, offset_cur);
        ...... // comment out the rest of the code inside the loop body
    }

// function: mat_vec_mul
        for(i=0; i<m_size; ++i){
            sum = 0.0;
            for(j=0; j<n_size; ++j){
Line 3:      sum  += a[i*n_size + j]*x[offsetx + j];   // comment or not
            }   
            y[i + offsety] = sum;
        }   

Experimental Results

  Keep Line 3: 11.87s
  Comment Line 3: 0.30s
wukefe commented 6 years ago

Notes for running benchmarks

check current node version

node -e 'console.log(process.versions.v8);'

Available node versions

- nvm use 8.0.0
- nvm use 8.9.1 

Run hmm

wu run hmm js node -v
wu run hmm js node -v -n 10
wukefe commented 6 years ago

See the bug report on Node.js: https://github.com/nodejs/node/issues/22467