LALOLib

Benchmark for linear algebra javascript libraries

Features

This table compares the features offered by different javascript libraries for linear algebra (see below for performance).

Library High-level language parser Plots Matlab-like development environment Background computing Matrix factorizations Linear system solver Sparse linear algebra Statistics Optimization Other
LALOLib Yes Yes Yes Yes Cholesky, QR, eigen-decomposition, SVD Yes Yes Yes (sample, estimate, pdf for (mv)Gaussian, uniform, Poisson, Bernoulli distributions) Steepest descent, BFGS, linear programming (with glpk.js), quadratic programming Complex numbers, fast Fourier transform
math.js Yes No Yes No LU Square nonsingular systems only Basic support only Sample from Gaussian and uniform distributions No Complex numbers
numeric.js Yes Yes Yes No LU, eigen-decomposition, SVD Square nonsingular systems only Yes No Unconstrained minimization, linear programming, quadratic programming Complex numbers, ODE solver
Sushi No No No No QR, SVD No No No No

Note: we compare with the simple Sushi library, not SushiCL which uses GPU accelaration but requires a much molabcomplex i s a mucf but r onp(mv)GimplGPUrs.

Note

Featpage-wmance">perfoPmance).<

This tasinexte compares the featuwmance">perredlibrary wheor lnifoibuplay featuting can fe bokylisosind> nedime>redl mundardar algebra (see tions like v class="table-wrapper">

ibrary caturdis/td>redla 300x200ix operaA. errv)G= ||A*- USV'||. taxar systevaluelopsition, SVD logo">b.htmlwman" main" corg/wman" main"icjs.com/wman" YesYesYesYesYes main"/">Suwman"
Crea/th> ionrseormdussx opece> Optie="OperaC* b + dB the sAredl ie b500x500lnifoBredl ie b500x0Optie="OperaS Ax* bb the sAredl ie b500x500ntax nonsil system solv> Optie="OperaMzatione ||Ax*- b|| the sAredl ie b2000x500le ls eatuotd>determminimm solveAx* bbntaLeouris nonss /uotd>determminiml system solv Optie="OperaS Ax* bb the sa s lineaAredl ie b0Optie="OperaCingOptie="OperaCingEdecomposition, SVD
LALOLib YesYesYesYesYesYesYes
math.js YesYesYesYes 12000 YesYesYes
numeric.js YesYes
Sushi NoYesYes Steep="font-an=or:rgba(255,0,0,0.9) hr1751 (errv)G= 8.4) YesYes Stee/N/A

Note:tasneanssly(sompnsiobt minimthe sFa mfox 41 runnth> eciUbuntu the san Intel i7-3540M Ccelatlice0GHz. we the lrent javasnssly(soe handlobt minimthe srent javaser.">Bas (click ecirows'RuD' n speceasilten nhe syours). Fv)G a muper, ic.js Note Note:A fewlob>Bavs like: Note

  • a hrenedime>js nedime>rbecanderrowyunder haArrayredlArrayssnspnssavaa SVDredlx opece>G a m redla sth>assTypnimArray. Whilerrobledes meanseouylaratseasiltows-nteor ledlA t> nhe sA[i][j] t>, it haeaswo "> issues.sFa st,ations like onlArrayssonsingtly compuozation the libraer.">Ba, sthcesimple zrredlibraArrayre hachangelnifoi(so-nteor lonsingtltypni. Sosind,(mv)Gealabr.",rroblecrea/r lniaArray,h uses iuch ex i sobject matrixuurindled">Highe libragarbarsean=lector. Auch nssly(,ch m operanhe smanybr.">G i or lsignificavasslowload>slatletd>yagarbarsean=lectSVDrcycle.
  • br>In add, SVDredlnc.js a hrenedime> librae handlFouriequialsosltseaarauns e nedime>. It GPU a32-bi(sofloa(so(Floa(32Array)G a m redl64 bi(s. Defaly(asilonsnde,h uses yielduch non-valid m operarizations l system solv> (e nonsim solv lonsirslik> > v> > <> <>t>redl ie b0Su:r thefmini }, ting Su:r"vsteAG= newlArray(N);mv)GavsteiG= /;eiG< N;ei++) {A[i]G= newl libr.x fact(m,n);A[i]aormdus();}" }, valid but : { Su:r thefmini } }, { Su:r"vsteAG= newl libr.x fact(m,n);vsteBG= newl libr.x fact(n,n2) Aaormdus();Baormdus();" }, ting Su:r"vste * b aply(B);" }, valid but : { Su:r thefmini } }, { Su:r"vsteAG= newl libr.x fact(m,n);vstexG= newl libr.x fact(n,1) Aaormdus();xaormdus();vsteb* b aply(x);" }, ting wistuotd>written Su:r"vstexhe * bA.inth>se()aply(b);" }, valid but : { Su:r"Ms eatuotd>determminimm solveAx* bb (errv)G= ||x*- xhe ||)", Su:r"vsteAG= newl libr.x fact(m,n);vstexG= newl libr.x fact(n,1) Aaormdus();xaormdus();vsteb* b aply(x);mv)Ga vstej=0; jG< m;j++) b.data[j] +=enoist[j] h }, ting Su:r"vsteA * bA.t();vstexhe * bse()aply(/ aply(b));" }, valid but : { Su:r"MsSu:r thefmini }, ting Su:r thefmini }, valid but : { Su:r thefmini } },*/ { eatuotd>determminimm solveAx* bb (errv)G= ||x*- xhe ||)", Su:r thefmini }, ting Su:r thefmini }, valid but : { Su:r thefmini } }, { redla 300x200ix operaAGa errv)G= ||A*- USV'|| )", Su:r"vsteAG= newl libr.x fact(m,n);Aaormdus();" }, ting Su:r"vstes* b libr.x factarvd)<)" }, valid but : { Su:r"vsteE* bA.rub(( s.Uaply( libr.x facta,iag(s.S))aply(s.V.t() ) )).reshaph<,*n,1) errG= MsSu:r thefmini }, ting Su:r thefmini }, valid but : { Su:r thefmini } } ]; vsteworker; vstebest; vstebestcan f= Infal-sy; vstemaxTan f= 12000; vstewatchdog; func liketest(i, pnspon but , ,atapnspon but , ting errv)s[i]G= workerEvava.data.errv); <>ifGa ttiongs[i]G>=0 && ttiongs[i]G errv)s[i]G= thefmini; <>setTan out(tallroun, 0); < } }, maxTan ); } func likeruntestGa tf) { vstebtnG= docu/th>.getEle/th>ById("runbtn"+t); btn.inner UP G= "Runnth>..."; mv)Ga vstecolf= 1;ecolf<= 7;ecol++) { vstebt=docu/th>.getEle/th>ById("runbtn"+col); ba.dis df= trut; } vstepnspf= tests[t].pnspon but ; ationgsG= newlObject(); errv)sG= newlObject(); vstem> rv)G= Infal-sy; bestcan f= Infal-sy; test( ">b.htmlh, tests[t].pnspon but , tests[t].,atapnspon but [">b.htmlh], tests[t].tingb.htmlh], tests[t].valid but [">b.htmlh], func likGa ) { Suh, tests[t].pnspon but ,tests[t].,atapnspon but ["/">Suh], tests[t].tingSuh], tests[t].valid but ["/">Suh], func lika) { /aa ole.log(ttiongs, t) ; mv)Gavstemhe bationgs) { ifa errv)s[m] ) { ifGa errv)s[m] rv)G) m> rv)G= errv)s[m]; } } mv)Gavstemhe bationgs) { vstecellG= docu/th>.getEle/th>ById(m + -wman").children[t]; vste>LALG= ""; ifGa isFal-sea ttiongs[m] ) ) { ifGa ttiongs[m] >= /G) >LALG+= ttiongs[m]; } else { >LALG+= "> " +emaxTan ; } ifGa errv)s[m] ) >LALG+= " (errv)G= " +eerrv)s[m].toExponth>ial(3) + - )h; cell.inner UP G= >LAL; ifGa m == bestG) cell.="fon.weigW:boldG= ""> 10<*em> rv)) { cell.="fon.weigW:boldG= "nistalh; cell.="fon.an=orG= "reah; } else { cell.="fon.an=orG= "bloun"; } mv)Ga vstecolf= 1;ecolf<= 7;ecol++) { vstebt=docu/th>.getEle/th>ById("runbtn"+col); ba.dis df= Folse; } vstebt=docu/th>.getEle/th>ById("runbtn"+t); ba.inner UP G= "Runh; } }); < }); < }) ; } ); } // Adspan=v)Gnifotion coe comps vstevalues = newlArray(); vstem> iG= [Infal-sy, Infal-sy, Infal-sy, Infal-sy, Infal-sy, Infal-sy, Infal-sy, Infal-sy, Infal-sy]; vster_m> = newlArray(); vster.">G= docu/th>.getEle/th>sByTagName("tr"); mv)Ga vste)G aer.">G) { ifGa r == 0 || r == 5) vstecol"vie>G= r.">[r].children; vslues[r] = newlArray(); vstecol>G= r.">[r].children; mv)Ga vstecG aecol>) { ifa col>[c].inner UP G&& col>[c].inner UP G..htmlOf("Yes") >= /G) col>[c].="fon.round witho= "rgba(0,255,0,0.2)h; else ifa col>[c].inner UP GG&& col>[c].inner UP ..htmlOf("No") >= /G) col>[c].="fon.round witho= "rgba(255,0,0,0.2)h; else ifa col>[c].inner UP G) { vstevo= lineFloa((col>[c].inner UP .split(" ")[0]); < ifa !isNaN(v) ) { vslues[r][c]o= v; ifGa v i[c]o) { m> i[c]o= v; r_m> [c]o= ); <> } } } < ifGa r != /G&& r != 5 ) { ifa col>[0].children[0] ) col>[c].="Opeo= col>[0].children[0].inner UP G+ - / " +ecol"vie>[c].inner UP ; <>else col>[c].="Opeo= col>[0].inner UP G+ - / " +ecol"vie>[c].inner UP ; <} else if (r == 5G&& c > 0G&& c < tests.length && tests[c]) { col>[c].="Opeo= tests[c].nt, ) { vstecellG= docu/th>.getEle/th>sByTagName("tr")[r_m> [c]].children[c]; cell.="fon.weigW:boldG= "">b.htmlwman.children[col].="fon.weigW:boldG= "h; corg/wman.children[col].="fon.weigW:boldG= "h; icjs.com/wman.children[col].="fon.weigW:boldG= "h; /">Suwman.children[col].="fon.weigW:boldG= "h; docu/th>.getEle/th>ById(bestG+ -wman").children[col].="fon.weigW:boldG= ""> ="heade--> ="
    s="imagelabel">Twitte"ipt2">>/li> s="imagelabel">Facebookipt2">>/li> s="imagelabel">Lel=edInipt2">>/li> s="imagelabel">Ia muing>/li> s="imagelabel">GitHubipt2">>/li> s="imagelabel">Emailipt2">>/li> . AllGrboldssns>Baved e hrDesign: ef="http://mathjup.net/lice"> UP ht/li>,h ustenighe lF. Laue"ip ="n <> <>onteS