Mikhail Korobov avatar Mikhail Korobov committed a1d859a

дополнительный бенчмарк (теги, наверное, часто будут приводить к строкам)

Comments (0)

Files changed (1)

benchmarks/speed.py

         for word, cnt in word_no_umlauts:
             morph.tag(word)
 
+    def _run_str():
+        for word, cnt in words:
+            str(morph.tag(word))
+
+
     logger.info("    tagger.tag: %0.0f words/sec (with freq. info)", utils.measure(_run, total_usages))
     logger.info("    tagger.tag: %0.0f words/sec (without freq. info)", utils.measure(_run_nofreq, len(words)))
-    logger.info("    tagger.tag: %0.0f words/sec (without freq. info, input umlauts removed)", utils.measure(_run_no_umlauts, len(words)))
+    logger.info("    tagger.tag: %0.0f words/sec (without freq. info, umlauts removed from input)", utils.measure(_run_no_umlauts, len(words)))
+    logger.info("    tagger.tag: %0.0f words/sec (without freq. info, str(tag) called)", utils.measure(_run_str, len(words)))
 
 
 def bench_parse(morph, words, total_usages):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.