丁云鹏 9 달 전
부모
커밋
af5f972fdc

+ 11 - 0
recommend-server-service/src/main/java/com/tzld/piaoquan/recommend/server/service/rank/strategy/RankStrategy4RegionMergeModelV552.java

@@ -168,9 +168,11 @@ public class RankStrategy4RegionMergeModelV552 extends RankStrategy4RegionMergeM
 
         log.info("handle feature 1 cost={}", rovRecallRank.size(),
                 stopwatch.elapsed(TimeUnit.MILLISECONDS));
+        stopwatch.reset().start();
 
         List<RankItem> rankItems = CommonCollectionUtils.toList(rovRecallRank, RankItem::new);
         for (RankItem item : rankItems) {
+
             Map<String, Double> featureMap = new HashMap<>();
             String vid = item.getVideoId() + "";
             Map<String, String> b1 = featureOriginVideo.getOrDefault(vid, new HashMap<>()).getOrDefault("alg_vid_feature_all_exp_v2", new HashMap<>());
@@ -196,6 +198,7 @@ public class RankStrategy4RegionMergeModelV552 extends RankStrategy4RegionMergeM
                     new Tuple4(b11, b12, b13, "b111213"),
                     new Tuple4(b17, b18, b19, "b171819")
             );
+            Stopwatch stopwatch2 = Stopwatch.createStarted();
 
             for (Tuple4 tuple4 : originData) {
                 for (String prefix2 : Arrays.asList("1h", "2h", "3h", "4h", "12h", "1d", "3d", "7d")) {
@@ -223,6 +226,9 @@ public class RankStrategy4RegionMergeModelV552 extends RankStrategy4RegionMergeM
                 }
             }
 
+            log.info("loop 1 cost={}", stopwatch2.elapsed(TimeUnit.MILLISECONDS));
+            stopwatch2.reset().start();
+
             Map<String, String> videoInfo = featureOriginVideo.getOrDefault(vid, new HashMap<>()).getOrDefault("alg_vid_feature_basic_info", new HashMap<>());
             featureMap.put("total_time", Double.parseDouble(videoInfo.getOrDefault("total_time", "0")));
             featureMap.put("bit_rate", Double.parseDouble(videoInfo.getOrDefault("bit_rate", "0")));
@@ -242,6 +248,9 @@ public class RankStrategy4RegionMergeModelV552 extends RankStrategy4RegionMergeM
                 }
             }
 
+            log.info("loop 2 cost={}", stopwatch2.elapsed(TimeUnit.MILLISECONDS));
+            stopwatch2.reset().start();
+
             if (!vid.isEmpty()) {
                 for (String key_feature : Arrays.asList("c8_feature", "c9_feature")) {
                     for (String key_action : Arrays.asList("share", "return")) {
@@ -265,6 +274,8 @@ public class RankStrategy4RegionMergeModelV552 extends RankStrategy4RegionMergeM
                 featureMap.put("d1_rovn", Double.parseDouble(d1.getOrDefault("rovn", "0")));
             }
             item.featureMapDouble = featureMap;
+            log.info("loop 3 cost={}", stopwatch2.elapsed(TimeUnit.MILLISECONDS));
+            stopwatch2.reset().start();
         }
 
         log.info("handle feature 2 cost={}", stopwatch.elapsed(TimeUnit.MILLISECONDS));