QuantEcon / QuantEcon/QuantEcon.py

ENH: make calls to `compute_fixed_point` allocate less memory

Open
#40 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement performance
Dominant language
Python
Stars
2.4k
Forks
2.3k
Avg merge
3d 3h
Merged PRs (30d)
3

Description

The idea is quite simple: whenever we call compute_fixed_point(T, ...) we should update the definition of T so that any temporary arrays can be optionally supplied by the caller. See the new compute_lt_price function in the LucasTree class of quantecon/models/lucastree.py for an example (there we avoid allocating Tf on each iteration).

Contributor guide

Open the contributing guide

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.

Research direction

Start by locating the definition of compute_fixed_point and reviewing the compute_lt_price function in quantecon/models/lucastree.py. Trace the calls to compute_fixed_point and identify temporary arrays that can be supplied by callers. Done means those calls can reuse caller-provided arrays and avoid unnecessary per-iteration allocations.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.