# Grassmann.jl A\\b 3x faster than Julia's StaticArrays.jl

**URL:** <https://discourse.julialang.org/t/grassmann-jl-a-b-3x-faster-than-julias-staticarrays-jl/41451>\
**Category:** Performance\
**Tags:** package, announcement, array\
**Created:** [June 15, 2020, 4:12pm UTC](https://discourse.julialang.org/t/grassmann-jl-a-b-3x-faster-than-julias-staticarrays-jl/41451 "2020-06-15T16:12:53Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![Mason](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mason/32/2423_2.png) [@Mason](https://discourse.julialang.org/u/Mason)\
**Post date:** [June 17, 2020, 11:37pm UTC](https://discourse.julialang.org/t/grassmann-jl-a-b-3x-faster-than-julias-staticarrays-jl/41451/22 "2020-06-17T23:37:07Z")

</div>

> [@Per](#):
>
> I’m only guessing, but I think that the reason why "return value allocation is definitely not `pure` " is that it depends on where heap memory is available, and this is is a global state.
> 
> Example:
> 
> ```julia
> f() = []
> f() === f() # returns false
> 
> ```
> 
> The function `f` is not pure, since calling it with the same (empty) set of immutable arguments does not return the same result.

That may be a relevant factor but I think a much bigger and harder to avoid problem is that the method table _itself_ is a global mutable state. Hence any function which relies on the state of the method table is itself impure.

That means no generic, multiple dispatch functions should be called inside a `@pure` function body, which is almost impossible in Julia.

This mutability in the method table may not effect you if you’re not hot-modifying it, however, it seems like it’s liable to cause weird, hard to reproduce bugs if other people were to try and build tools on top of Grassmann.jl, adding their own methods and overloading your functions (or if someone pirated the methods you use, or if you pirate someone else’s methods).

This seems especially worrisome since you do have a tenancy to advertise Grassmann.jl as something people should adapt their project to make use of, so if someone did act on that it could result in an unfortunate situation.

---

_[View the full topic](https://discourse.julialang.org/t/grassmann-jl-a-b-3x-faster-than-julias-staticarrays-jl/41451)._
