mapbox / mapbox/MapboxGeocoder.swift

MBPlacemark should store property values parsed from GeoJSON

Open
#24 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
133
Forks
46
PR merge metrics
No merged PRs in 30d

Description

Each property that’s parsed out of MBPlacemark’s backing GeoJSON is potentially expensive, especially when accessed frequently. It’s easy to come up with a pathological case that involves putting addressDictionary fields into a table view cell. Since the backing GeoJSON is immutable, these property values should be lazily computed then stored for the lifetime of the object.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Locate MBPlacemark and inspect how its backing GeoJSON supplies properties such as addressDictionary. Confirm which values are recomputed on repeated access, then add lifetime caching while preserving the existing property behavior. Done means repeated property access no longer reparses the immutable GeoJSON.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
mobile-dev
Issue type
Refactor
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.