Skip to content
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

Wasted work in cld::GetNormalizedScore() and cld::GetReliability() #2

Closed
GoogleCodeExporter opened this issue Mar 15, 2015 · 3 comments

Comments

@GoogleCodeExporter
Copy link

The problem appears in revision 215539. I have attached a simple one-line patch 
that fixes it.

In method cld::GetNormalizedScore() in cld/compact_lang_det/cldutil.cc, the 
loop in line 818 keeps overriding "expected_score" with "kMeanScore[cur_lang * 
4 + i]" when it is larger than zero. Therefore, only the last written value is 
visible out of the loop and all the other writes and iterations are not 
necessary. The patch iterates from the end of "i" and breaks the first time 
when "expected_score" is set.

Similar problem also appears in cld::GetReliability(), at line 846.


Original issue reported on code.google.com by pochang0...@gmail.com on 6 Aug 2013 at 8:45

@GoogleCodeExporter
Copy link
Author

https://codereview.chromium.org/22321003/

Original comment by pochang0...@gmail.com on 6 Aug 2013 at 8:46

@GoogleCodeExporter
Copy link
Author

This issue is about the original cld project (retronym: CLD1), not the current 
CLD2 project. cld is largely abandoned now. The performance bug described does 
not occur in CLD2. /dick

Original comment by dsi...@google.com on 9 Aug 2013 at 6:28

@GoogleCodeExporter
Copy link
Author

Original comment by dsi...@google.com on 9 Aug 2013 at 6:39

  • Changed state: WontFix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant