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

Add primitives for fast access to bigarray dimensions #5762

Closed
vicuna opened this issue Sep 20, 2012 · 2 comments
Closed

Add primitives for fast access to bigarray dimensions #5762

vicuna opened this issue Sep 20, 2012 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Sep 20, 2012

Original bug ID: 5762
Reporter: @chambart
Assigned to: @lefessan
Status: closed (set by @xavierleroy on 2015-12-11T18:08:20Z)
Resolution: fixed
Priority: normal
Severity: feature
Version: 4.00.0
Fixed in version: 4.01.0+dev
Category: back end (clambda to assembly)
Monitored by: @chambart @hcarty

Bug description

Bigarray.Array1.dim is a generic C function that may be called a lot when doing IO using bigarrays. It is a lot slower than what can be done directly in cmm.

I provide a patch to add the primitives for Array1,Array2 and Array3 modules.

The loop:

for i = 0 to n do
ignore (Array1.dim a);
done

is close to 10 times faster with the patch.

File attachments

@vicuna
Copy link
Author

vicuna commented Sep 24, 2012

Comment author: @chambart

I forgot to record bytecomp/bytegen.ml in the first patch

@vicuna
Copy link
Author

vicuna commented Nov 6, 2012

Comment author: @lefessan

Committed in trunk as r13069.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants