Modify

Opened 3 years ago

Closed 3 years ago

Last modified 3 years ago

#4037 closed enhancement (fixed)

[PATCH] LiveGps: Frequent position updates leech too much CPU on low-end devices

Reported by: casualwalker Owned by: casualwalker
Priority: normal Component: Plugin
Version: Keywords:
Cc:

Description

LiveGps Plugin redraws the screen each time it receives a new set of data from GPSD, which is about once per second.

When JOSM runs on a low-end device (such as a netbook), JOSM reacts very sluggish to user-input, as all CPU power is consumed by frequent updates.

Proposed solution:

  • LiveGPS suppresses update events, until a minimal amount of time has elapsed, by default this is set to 5 sec.
  • This interval can be configures in a config value named "livegps.refreshinterval" (in milliseconds).

This was already mentioned in the Wiki, although this is not the right place...
http://wiki.openstreetmap.org/index.php/JOSM/Plugins/LiveGPS#TODOs

I already implemented this feature, it even worked outside ;-)

Patches will follow, as soon as I clean up the code a bit.

Attachments (2)

Patch_LiveGpsSuppressor.java (3.4 KB) - added by casualwalker 3 years ago.
Patch File LiveGpsSuppressor.java
Patch_LiveGpsAcquirer.java (17.6 KB) - added by casualwalker 3 years ago.
Patch for LiveGpsAcquirer.java

Download all attachments as: .zip

Change History (8)

comment:1 Changed 3 years ago by casualwalker

  • Owner changed from team to casualwalker

comment:2 Changed 3 years ago by casualwalker

  • Status changed from new to assigned

Patches will follow within the next few days.

Changed 3 years ago by casualwalker

Patch File LiveGpsSuppressor.java

Changed 3 years ago by casualwalker

Patch for LiveGpsAcquirer.java

comment:3 Changed 3 years ago by casualwalker

  • Resolution set to fixed
  • Status changed from assigned to closed

If you have any questions re these patches or need another format, re-open this bug and ask me.

comment:4 Changed 3 years ago by stoecker

  • Resolution fixed deleted
  • Status changed from closed to reopened
  • Summary changed from LiveGps: Frequent position updates leech too much CPU on low-end devices to [PATCH] LiveGps: Frequent position updates leech too much CPU on low-end devices

Don't close tickets until patches have been applied. Closed tickets are history. Nobody cares for them.

comment:5 Changed 3 years ago by stoecker

  • Resolution set to fixed
  • Status changed from reopened to closed

In [o18941].

Some rules for next time

  • Use .diff or .patch as extension
  • Only one patchfile
  • Don't reformat code you did not change
  • Don't leave pointless debug code inside

comment:6 Changed 3 years ago by casualwalker

Got myself a svn account and improved this feature some more:

  • Config setting is in seconds
  • Set to 0 disables the suppression
  • each position from gpsd still will be added to the layer (and the track); so, when the display is eventually refreshed, you "suddenly" see a couple of new positions. Thus, no position is lost and JOSM is still responsive.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed .
as The resolution will be set. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.