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

vicuna opened this Issue Sep 20, 2012 · 2 comments


None yet
2 participants
Copy link

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);

is close to 10 times faster with the patch.

File attachments


This comment has been minimized.

Copy link
Collaborator Author

commented Sep 24, 2012

Comment author: @chambart

I forgot to record bytecomp/ in the first patch


This comment has been minimized.

Copy link
Collaborator Author

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
You can’t perform that action at this time.