Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Performance: interval reads, event transforms, query copies, and HTTP exports

Aperta
#671 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
45/100
Tipo di issue
Refactoring
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust, sqlite

Direzione di ricerca

La issue fa riferimento a cinque PR specifiche (#676, #674, #673, #675, #677), ciascuna delle quali mira a un diverso collo di bottiglia delle prestazioni. Inizia esaminando le PR collegate per comprendere le modifiche alle interval queries, a union_no_overlap, a merge_events_by_keys, alla copia degli argomenti di query e alla serializzazione dell’esportazione HTTP. Esegui i benchmark inclusi nelle PR per verificare i miglioramenti. La validazione richiede la comprensione di Rust, degli indici SQLite e del modello dei dati degli eventi di ActivityWatch.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Track five independent performance improvements identified while reviewing 02ae248. Each fix has its own PR, independently based on master.

  • Reduce historical scanning for bounded event interval queries — #676. Add a selectively used endtime-first index while preserving overlap semantics, tie ordering, and fast limited newest-first reads. The PR documents index storage/migration costs and measured bulk-insert overhead.
  • Make union_no_overlap linear in input size and emitted fragments — #674. Replace repeated middle-of-vector insertions with a pending remainder and move events where possible.
  • Reduce allocations in merge_events_by_keys — #673. Remove the unused per-group map, use the entry API, and move the first event into each group instead of cloning its JSON.
  • Avoid deep event-list copies for read-only query functions — #675. Borrow simple variable/literal arguments without changing query language value semantics. Related background: #119, #122, #183.
  • Bound HTTP export memory — #677. Serialize one row at a time into a private temporary file and serve the completed file, preserving the export format, acknowledged writes, and pre-download HTTP errors. Temporary disk use and datastore-worker occupancy are documented tradeoffs.

Initial local probes (synthetic data, not end-to-end application measurements):

  • A recent interval containing 1,001 events in a million-row in-memory SQLite database took 44.9 ms with the current index versus 0.41 ms with a forced end-time-first index. This is evidence to evaluate query selection, not a recommendation to replace the existing index unconditionally.
  • Overlap merging took 176 ms at 16,000 events per input and 632 ms at 32,000 events per input.
  • A grouping prototype reduced 50,000 distinct groups from 22.6 ms to 10.3 ms; with 100 groups the improvement was 11.2 ms to 10.3 ms.

Android context: ActivityWatch/aw-android#229 fixes saving WebView exports and persists queued payloads in cache files. It does not remove full-payload buffering in the Rust HTTP export path; the WebView bridge also still assembles a complete string. This item targets the Rust HTTP path only.

Validation should include representative scaling benchmarks, regression coverage for behavior and edge cases, and independent crate/API checks per PR. Checklist items remain open until their fixes are merged.

Implementation validation uses synthetic in-memory data and isolated temporary test databases only; no live database or running server was used. Reproducible benchmarks/examples are included in the PRs. Additional comparisons against upstream 02ae248:

  • Rust interval benchmark, one million rows: recent 1,001-row retrieval ≈24.1 ms → 0.40 ms; recent count ≈19.7 ms → 19 µs. A 10,000-row insert probe measured ≈20% overhead for maintaining the extra index.
  • Query workload, 50,000 events and 20 duration sums: ≈118.8 ms → 15.8 ms, including retrieval.
  • Export serializer, 100,000 events with 256-character titles: peak RSS ≈194 MiB materialized → 52 MiB incremental. This includes the synthetic in-memory input database and excludes temporary-file I/O; it is not an HTTP throughput measurement.
Lingua principale
Rust
Stelle
317
Fork
99
Merge medio
1g 13h
PR unite (30g)
66

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di ActivityWatch/aw-server-rust

Tutte le issue di ActivityWatch/aw-server-rust

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.