Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Faster JS implementation of rand_mat_mul. #4067

Merged
merged 1 commit into from
Aug 15, 2013

Conversation

srikumarks
Copy link
Contributor

A slightly tweaked rand_mat_mul function that uses B's transpose
to improve sequential memory access during the multiplication. This
speeds up the JS run and, I think, is a fairer comparison with
other languages which call on custom routines to do the multiplication.

A slightly tweaked rand_mat_mul function that uses B's transpose
to improve sequential memory access during the multiplication. This
speeds up the JS run and, I think, is a fairer comparison with
other languages which call on custom routines to do the multiplication.
@Keno
Copy link
Member

Keno commented Aug 15, 2013

Do you have any number on what kind of impact this makes in JS?

@srikumarks
Copy link
Contributor Author

I get about 3x speed up on my MacBook Air when run in Node.js v0.8.17. Of course, the result can be expected to vary between machines.

JeffBezanson added a commit that referenced this pull request Aug 15, 2013
Faster JS implementation of rand_mat_mul.
@JeffBezanson JeffBezanson merged commit dc6ca33 into JuliaLang:master Aug 15, 2013
@srikumarks
Copy link
Contributor Author

Btw using Float64Array in the matmul function gives some extra speed up, but it is not much - only about 3%.

@ViralBShah
Copy link
Member

If node.js has an FFI to call BLAS, that is what we really should be doing. Of course, it would be installation hell if we had to go hunting for this stuff in external packages, but we can certainly accommodate it if it is part of the standard node distribution.

@srikumarks
Copy link
Contributor Author

Not hard, but requires the 'ffi' and 'ref' npm modules to be installed. Here is some code that might do it - https://gist.github.com/srikumarks/6240337

I didn't send it in as a pull request because I'm not sure how the necessary npm installs will be done by julia's build system.

I got some hilarious results when I tried it. Overall, the randmatmul test ran about 10x faster than the original benchmark (about 3x faster than the changed one I submitted). However, with the BLAS-based version, 90% of the time was being spent filling the matrices with random numbers :)

@StefanKarpinski
Copy link
Member

The cost of random number generation really ought to be factored out of our microbenchmarks. The benchmarks don't really need to build on arbitrary systems, just our benchmarking system, so if you do have a patch that lets JavaScript call a BLAS, please do submit it and we can try to make it work. Speaking of which, we really need to run the benchmarks on our research machine and update the results.

@ViralBShah
Copy link
Member

Best to update with the release 0.2 version, now that we are close enough. In general, the website needs a huge update as well.

IanButterworth added a commit that referenced this pull request Nov 4, 2024
…5417c (#56437)

Stdlib: Pkg
URL: https://github.com/JuliaLang/Pkg.jl.git
Stdlib branch: release-1.11
Julia branch: backports-release-1.11
Old commit: af1088b4e
New commit: 2c625417c
Julia version: 1.11.1
Pkg version: 1.11.0(Does not match)
Bump invoked by: @IanButterworth
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaLang/Pkg.jl@af1088b...2c62541

```
$ git log --oneline af1088b4e..2c625417c
2c625417c Merge pull request #4072 from JuliaLang/backports-release-1.11
c3be33218 REPLExt: check for compliant repl mode during repl init (#4067)
```
jishnub pushed a commit that referenced this pull request Nov 21, 2024
Stdlib: Pkg
URL: https://github.com/JuliaLang/Pkg.jl.git
Stdlib branch: master
Julia branch: master
Old commit: 9f8e11a4c
New commit: 7b759d7f0
Julia version: 1.12.0-DEV
Pkg version: 1.12.0
Bump invoked by: @IanButterworth
Powered by:
[BumpStdlibs.jl](https://github.com/JuliaLang/BumpStdlibs.jl)

Diff:
JuliaLang/Pkg.jl@9f8e11a...7b759d7

```
$ git log --oneline 9f8e11a4c..7b759d7f0
7b759d7f0 Automatically upgrade empty manifest files to v2 format (#4091)
69c6de019 Remove duplicated word "different" (#4088)
87a4a9172 Actually switch to "Resolving Deltas" (#4080)
ef844e32f Update CHANGELOG.md: link to [sources] PR (#4084)
e10883ce5 REPLExt: check for compliant repl mode during repl init (#4067)
```

Co-authored-by: Dilum Aluthge <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants