mapbox cost too much cpu
還沒有人認領這個 Issue。
評估
- 難度
- 4/5
- 預估耗時
- 3-5 天
- 新手友好度
- 20/100
- Issue 類型
- 缺陷
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- java
- 領域
- performance
研究方向
從提供的 inRing 方法和用於 100,000 多個城市的 PointCustom 清單開始;檢查其呼叫路徑,並在每秒 100 個請求的情況下對工作負載進行效能分析。將完成定義為保留位置結果,同時證明在可比較的生產環境負載下 CPU 使用率更低。
由索引模型根據 Issue 內容生成。
描述
I overwrite the code like here:
public static boolean inRing(PointCustom pt, List<PointCustom> pointCustomList) {
boolean isInside = false;
for (int i = 0, j = pointCustomList.size() - 1; i < pointCustomList.size(); j = i++) {
double xi = pointCustomList.get(i).getLongitude();
double yi = pointCustomList.get(i).getLatitude();
double xj = pointCustomList.get(j).getLongitude();
double yj = pointCustomList.get(j).getLatitude();
boolean intersect = (
(yi > pt.getLatitude()) != (yj > pt.getLatitude()))
&& (pt.getLongitude() < (xj - xi) * (pt.getLatitude() - yi) / (yj - yi) + xi);
if (intersect) {
isInside = !isInside;
}
}
return isInside;
}
but i run it on the production.and find that the cpu of server cost too much ,200% CPU is consumed frequently when send 100 requests per second.
My demand is to locate in the longitude and latitude data of 100000 cities through longitude and latitude。
And the args of varible : pointCustomList storage 100000+ CityInfo object.
What problem can reduce the cost of CPU?
- 主要語言
- Java
- 星號
- 438
- 分支
- 117
- PR 合併指標
- 30 天內沒有已合併 PR
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
mapbox/mapbox-java 的其他 Issue
-
難度 2/5 1-3 小時 新手友好度 72/100
mapbox/mapbox-java#1640 ·
-
難度 4/5 3-5 天 新手友好度 55/100
mapbox/mapbox-java#1635 ·
-
難度 5/5 一週以上 新手友好度 15/100
mapbox/mapbox-java#1619 ·
-
Mapbox-java incompatible with gson 2.13.0 and up - call to internal GSON classes that were renamed 未關閉
難度 2/5 1-3 小時 新手友好度 48/100
mapbox/mapbox-java#1614 · 2 則留言 · 1 個 reaction ·
-
難度 5/5 一週以上 新手友好度 20/100
mapbox/mapbox-java#1612 · 1 個 reaction ·
查看 mapbox/mapbox-java 的全部 Issue
相似的 Issue
-
awaiting triage bug Causes friction Hop Gui P1 P2 Transforms
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 75/100
apache/flink-agents#1152 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
-
難度 2/5 1-3 小時 新手友好度 70/100
jenkinsci/blueocean-plugin#5417 ·
-
難度 2/5 1-3 小時 新手友好度 75/100
objectionary/eo-graphs#75 ·