You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
aliasmemory_size=65536fnmain():
_ = 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
aliasmemory_size=8fnmain():
_ = 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)
The text was updated successfully, but these errors were encountered:
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
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
If we compile with
unsafe_uninitialized
or change the array smaller then the compilation is fast again:System information
The text was updated successfully, but these errors were encountered: