ash-project / ash-project/ash

performance: expression calculations are hydrated 3 times

Open
#1,444 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Elixir
Stars
2.5k
Forks
422
Avg merge
23h 26m
Merged PRs (30d)
46

Description

Hydrating expressions is relatively expensive: .5ms is typical in a real app for a first_name <> last_name (although using flame on, so it's probably slowed down by the instrumentation)

There may be opportunities to improve performance of the hydration, but it appears that there are circumstances where the hydration occurs 3 times in a load so if it can be done once, that would improve performance:

Top level:
Screenshot 2024-09-07 at 10 02 30 AM

Zoom in on first two examples:
Screenshot 2024-09-07 at 10 03 07 AM

Zoom in on third example:
Screenshot 2024-09-07 at 10 03 56 AM

Contributor guide

Open the contributing guide

Research direction

No files, tests, or entry points are named. Start by reproducing a load involving a first_name <> last_name expression with flame instrumentation, then trace where expression hydration occurs. Done means confirming hydration happens once per load without changing the resulting expression values, and measuring the performance difference.

Written by the indexing model from the issue text.

Assessment

Tech stack
elixir
Domain
backend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.