Skip to content

refactor: best trades calculations to be done faster #216

@dd84ai

Description

@dd84ai

flathack — 4:32 PMSunday, April 19, 2026 at 4:32 PM
I had to optimize the route calculation for Discovery because it generates 1 million profitable trade pairs, and the engine was computing expensive travel-time metrics for every single candidate only to keep 85 winners. So I switched to a two-phase approach: first select the best route per source system by raw profit alone, then compute travel times only for those 85 winners instead of all candidates.

Darkwind The Dark Duck — 4:33 PMSunday, April 19, 2026 at 4:33 PM

So I switched to a two-phase approach: first select the best route per source system by raw profit alone, then compute travel times only for those 85 winners instead of all candidates.

Darkwind The Dark Duck — 4:35 PMSunday, April 19, 2026 at 4:35 PM
that is in fact big issue for me too, which i still solve in a brute forcing way through all routes
I just filter away all bad routes in terms of profits and profits per second, and offloaded calculations to be done in background.
Still issue with calculations taking 7 seconds though to give me 2000-3000 best trade deals
Those are interesting thoughts to consider how to make it faster, some preoptimizations to filter away bad routes in advance. i should think about it

Metadata

Metadata

Assignees

No one assigned

    Type

    No fields configured for Task.

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions