# Bad performance: using structs to find substrings

**URL:** <https://discourse.julialang.org/t/bad-performance-using-structs-to-find-substrings/74177>\
**Category:** New to Julia\
**Tags:** performance\
**Created:** [January 7, 2022, 8:18am UTC](https://discourse.julialang.org/t/bad-performance-using-structs-to-find-substrings/74177 "2022-01-07T08:18:48Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [January 7, 2022, 2:15pm UTC](https://discourse.julialang.org/t/bad-performance-using-structs-to-find-substrings/74177/14 "2022-01-07T14:15:40Z")

</div>

> [@Vasily\_Pisarev](#):
>
> Using broadcast `coverage[inds,:] .+= 1` should improve the performance.

Still allocates unless you use `@views`. See [Allocation when assigning to a slice - #3 by stevengj](https://discourse.julialang.org/t/allocation-when-assigning-to-a-slice/73381/3)

---

_[View the full topic](https://discourse.julialang.org/t/bad-performance-using-structs-to-find-substrings/74177)._
