imaNNeo / imaNNeo/fl_chart

Get Nearest Touched Spot Slow for Large Datasets

Open Beginner friendly
#2,100 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
7.6k
Forks
2k
Avg merge
9d 1h
Merged PRs (30d)
2

Description

The `getNearestTouchedSpot` function is really slow for large datasets (think 70,000 data points).

When snooping through the code, I noticed that when searching for the nearest spot, the LineChartPainter iteratively builds a list of all the spots in every trace. Expanding a list can be quite expensive, especially if you are only trying to track a single value.

Since this is a relatively easy fix, I will file a MR shortly

Contributor guide

Open the contributing guide

Research direction

Start by locating getNearestTouchedSpot and the LineChartPainter implementation, then trace how spots are collected for each trace. Benchmark or profile the nearest-spot search with a large dataset and verify that it avoids building unnecessary lists while returning the same result.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart
Domain
data-visualization, performance
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.