frigate/frigate
Daniel-dev22 21c792c22b perf(track): avoid per-frame allocations and list lookups in tracker
Two small per-object-per-frame improvements in the tracker hot path
(match_and_update), both bit-identical:

- get_stationary_threshold returned a freshly constructed StationaryThresholds
  (a dataclass plus a list) on every call for any label not in the three
  known lists - i.e. for common labels like person/dog. The default thresholds
  are constant and never mutated, so return a shared module-level singleton,
  as the other three cases already do.
- untracked_object_boxes membership used `box not in [list of boxes]` (O(n));
  build a set of box tuples for O(1) membership. Boxes are hashable as tuples
  and output is unchanged.

get_stationary_threshold appeared in a live py-spy --gil profile of a camera
process_frames worker. Adds tests for the threshold lookups.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-20 09:42:22 -04:00
..
api Miscellaneous fixes (#23513) 2026-06-19 10:10:22 -06:00
camera Debug replay resolution (#23287) 2026-05-22 08:39:52 -06:00
comms Restore runtime state on startup (#23326) 2026-05-27 12:03:09 -06:00
config UI tweaks (#23492) 2026-06-16 08:56:52 -05:00
data_processing Miscellaneous fixes (#23177) 2026-05-12 10:20:39 -06:00
db More mypy cleanup (#22658) 2026-03-26 12:54:12 -06:00
detectors Miscellaneous fixes (#23394) 2026-06-04 12:48:58 -06:00
embeddings Debug replay fixes (#23276) 2026-05-21 08:12:53 -06:00
events Miscellaneous fixes (#23335) 2026-05-29 06:53:17 -06:00
genai Allow GenAI providers to be initialized lazily (#23482) 2026-06-14 11:40:33 -05:00
images Replace green screen with error message and force camera_fps to 0 (#4544) 2022-11-28 21:47:20 -06:00
jobs Refactor motion search (#23378) 2026-06-01 12:08:46 -05:00
motion Optimize more mypy classes (#22637) 2026-03-25 12:53:19 -06:00
object_detection Miscellaneous fixes (#23279) 2026-05-22 07:52:01 -06:00
output Refactor move_preview_frames function (#23264) 2026-05-20 10:52:47 -06:00
ptz guard norfair distance against non-finite and zero-area boxes that could crash autotracking cameras (#23475) 2026-06-13 16:23:30 -05:00
record Replace export ffmpeg argument blocklist with a structural allowlist (#23478) 2026-06-13 16:43:22 -06:00
review Inverse mypy and more mypy fixes (#22645) 2026-03-25 19:30:59 -05:00
service_manager Add metrics page for embeddings and face / license plate processing times (#15818) 2025-02-08 12:47:01 -06:00
stats Miscellaneous fixes (#23317) 2026-05-27 09:19:11 -06:00
test perf(track): avoid per-frame allocations and list lookups in tracker 2026-06-20 09:42:22 -04:00
track perf(track): avoid per-frame allocations and list lookups in tracker 2026-06-20 09:42:22 -04:00
util Add recording keyframe analysis to camera probe dialog (#23453) 2026-06-11 14:16:41 -06:00
video Add recording keyframe analysis to camera probe dialog (#23453) 2026-06-11 14:16:41 -06:00
__init__.py app container and config schema 2021-01-26 21:40:33 -06:00
__main__.py Handle SIGINT with forkserver (#18860) 2025-08-16 10:20:33 -05:00
app.py Miscellaneous fixes (#23358) 2026-05-30 21:35:03 -06:00
const.py Improve credential redaction handling (#23265) 2026-05-20 15:59:01 -06:00
debug_replay.py Miscellaneous fixes (#23317) 2026-05-27 09:19:11 -06:00
ffmpeg_presets.py Upgrade ffmpeg to 8 by default (#23393) 2026-06-03 12:28:28 -05:00
log.py Add languages (#21870) 2026-02-03 13:29:52 -06:00
models.py Improve motion review and add motion search (#22253) 2026-03-05 17:53:48 -06:00
mypy.ini More mypy cleanup (#22658) 2026-03-26 12:54:12 -06:00
plus.py fix: upload_image parses response body before checking HTTP status (#22475) 2026-03-16 17:34:30 -06:00
storage.py Improve readability by removing trailing digits caused by floating number conversion (#22934) 2026-04-20 06:35:48 -06:00
timeline.py Display more scores in Tracking Details (#22799) 2026-04-07 10:06:22 -06:00
types.py Media sync API refactor and UI (#21542) 2026-02-26 21:27:56 -07:00
watchdog.py Miscellaneous fixes (#23032) 2026-04-29 16:20:19 -06:00