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

[BUG] Compilation time increases linearly with initialized InlineArray size #3973

Open
hypno2000 opened this issue Jan 27, 2025 · 0 comments
Labels
bug Something isn't working mojo-repo Tag all issues with this label

Comments

@hypno2000
Copy link

hypno2000 commented Jan 27, 2025

Bug description

I’ve observed that the compilation time appears to scale linearly with the size of an InlineArray. Below is a minimal example that demonstrates the issue.

Steps to reproduce

from collections import InlineArray

alias memory_size = 65536

fn main():
    _ = InlineArray[UInt8, memory_size](0)
> time mojo build src/test.mojo                                                   
mojo build src/test.mojo  27.27s user 0.98s system 102% cpu 27.554 total

If we compile with unsafe_uninitialized or change the array smaller then the compilation is fast again:

from collections import InlineArray

alias memory_size = 8

fn main():
    _ = InlineArray[UInt8, memory_size](0)
> time mojo build src/test.mojo                                                   
mojo build src/test.mojo  0.24s user 0.06s system 118% cpu 0.253 total

System information

- Apple M2 Ultra, MacOS 15.2
- mojo 25.1.0.dev2025012705 (304c3219)
- magic 0.6.3 - (based on pixi 0.40.3)
@hypno2000 hypno2000 added bug Something isn't working mojo-repo Tag all issues with this label labels Jan 27, 2025
@hypno2000 hypno2000 changed the title [BUG] Compilation time increases linearly with initialised InlineArray size [BUG] Compilation time increases linearly with initialized InlineArray size Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working mojo-repo Tag all issues with this label
Projects
None yet
Development

No branches or pull requests

1 participant