-
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use all bus data #84
Comments
Store raw data in cache, DO NOT STORE OBJECTS; will cause memory issues. < 10,000 busses https://bt.mta.info/wiki/Developers/SIRIVehicleMonitoring
|
Only this subclass needs to be modified
Stop monitoring should derive values from vehicle request if possible. |
JSON parser needs to be massively optimized to avoid memory issues; use JIT (just-in-time) parsing, where we load immediate keys into memory, then parse the subsequent object when requested.
https://sites.google.com/site/gson/streaming https://stackoverflow.com/a/11876086 Regex may actually be more inefficient since we are rescanning the string multiple times. Use character loop stream instead. Return a method to parse for: OneMTA/src/main/java/dev/katsute/onemta/Json.java Lines 197 to 200 in f3dfe30
and OneMTA/src/main/java/dev/katsute/onemta/Json.java Lines 235 to 238 in f3dfe30
|
@mashiro-san create a branch upgrade-json |
@Katsute I have created a new branch |
|
Use CopyOnWriteArrayList to allow concurrent reads and locked writes. In order to make write thread safe, have synchronized write block also check if its expired before fetching (any current active writes will make the result not expired, any queued writes will see that the resource is no longer expired and will return the new one instead). Get first then check if expired to prevent concurrency issues. |
@mashiro-san create a new branch upgrade cache |
@Katsute I have created a new branch |
Possibly use #100 to implement this. |
Feature
Anytime a bus is requested:
Reason
Current implementation runs a new request for every bus which is not efficient for enterprise. Requesting all busses then parsing is more efficient when submitting multiple requests.
The text was updated successfully, but these errors were encountered: