mahout-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From o...@apache.org
Subject svn commit: r765243 - in /lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file: BooleanPrefUserFileDataModel.java FileDataModel.java
Date Wed, 15 Apr 2009 15:33:10 GMT
Author: otis
Date: Wed Apr 15 15:33:09 2009
New Revision: 765243

URL: http://svn.apache.org/viewvc?rev=765243&view=rev
Log:
- Log debug only when needed in tight loops - save on objects when reading input files

Modified:
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/BooleanPrefUserFileDataModel.java
    lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/FileDataModel.java

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/BooleanPrefUserFileDataModel.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/BooleanPrefUserFileDataModel.java?rev=765243&r1=765242&r2=765243&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/BooleanPrefUserFileDataModel.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/BooleanPrefUserFileDataModel.java
Wed Apr 15 15:33:09 2009
@@ -95,7 +95,8 @@
     log.info("Reading file info...");
     for (String line : new FileLineIterable(dataFile, false)) {
       if (line.length() > 0) {
-        log.debug("Read line: {}", line);
+        if (log.isDebugEnabled())
+          log.debug("Read line: {}", line);
         processLine(line, data);
       }
     }
@@ -133,7 +134,8 @@
       data.put(userID, prefs);
     }
     prefs.add(itemID);
-    log.debug("Read item '{}' for user ID '{}'", itemID, userID);
+    if (log.isDebugEnabled())
+      log.debug("Read item '{}' for user ID '{}'", itemID, userID);
   }
 
   private void checkLoaded() {

Modified: lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/FileDataModel.java
URL: http://svn.apache.org/viewvc/lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/FileDataModel.java?rev=765243&r1=765242&r2=765243&view=diff
==============================================================================
--- lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/FileDataModel.java
(original)
+++ lucene/mahout/trunk/core/src/main/java/org/apache/mahout/cf/taste/impl/model/file/FileDataModel.java
Wed Apr 15 15:33:09 2009
@@ -166,7 +166,8 @@
     AtomicInteger count = new AtomicInteger();
     for (String line : new FileLineIterable(dataOrUpdateFile, false)) {
       if (line.length() > 0) {
-        log.debug("Read line: {}", line);
+        if (log.isDebugEnabled())
+          log.debug("Read line: {}", line);
         if (delimiter == UNKNOWN_DELIMITER) {
           delimiter = determineDelimiter(line);
         }
@@ -247,7 +248,8 @@
         item = buildItem(itemID);
         itemCache.put(itemID, item);
       }
-      log.debug("Read item '{}' for user ID '{}'", item, userID);
+      if (log.isDebugEnabled())
+        log.debug("Read item '{}' for user ID '{}'", item, userID);
       if (preferenceValueString == null) {
         prefs.add(new BooleanPreference(null, item));
       } else {



Mime
View raw message