Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Using `similar` for preallocation

Open
#59 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Tech stack
julia

Research direction

Start by reading src/definitions.jl at line 28 and tracing the preallocation path that avoids similar(x). Investigate the historical reason mentioned in the issue, then assess the StaticVector compatibility concern. Done means the project has a maintainer-approved resolution, with the behavior or rationale updated accordingly.

Written by the indexing model from the issue text.

Description

In line 28, whoever originally wrote this expressly went out of their way to avoid using y = similar(x). I can't seem to find any discussion as to why this was done except for the vague comment, but I'm currently trying to interface with AbstractFFTs and this would be a huge minus for me.
Currently, I'm respecting whatever type the user inputs. While just plugging in AbstractFFTs would likely work just fine, I think this behavior could be undesirable. For example, right now, using StaticVector as both input and output accelerates the algorithms tremendously, which is particularly consequential when performing many very small FFTs. I asked @ararslan about this a few weeks ago, and got the response that this was ported over from when AbstractFFTs was in Base. Is it still necessary to do this?

Dominant language
Julia
Stars
135
Forks
40
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JuliaMath/AbstractFFTs.jl

All issues in JuliaMath/AbstractFFTs.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.