Wasted work in line_uniq()

RESOLVED FIXED in mozilla33

Status

()

Core
Spelling checker
RESOLVED FIXED
5 years ago
4 years ago

People

(Reporter: pchang9, Assigned: pchang9)

Tracking

({perf})

Trunk
mozilla33
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fixed-in-hunspell-1.3.3])

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
Created attachment 780039 [details] [diff] [review]
Suggested patch

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0 (Beta/Release)
Build ID: 20130316161634

Steps to reproduce:

The problem appears in changeset 138350:18467a85acf6. I have attached a simple one-line patch that fixes it.

In method line_uniq() in extensions/spellcheck/hunspell/src/csutil.cpp, the loop on line 399 should break immediately after "dup" is set to "1". All the iterations after "dup" is set to "1" do not perform any useful work, at best they just set "dup" again to "1".



Expected results:

Break loop after "dup" is set to "1".
(Assignee)

Updated

5 years ago
Keywords: perf
Version: 19 Branch → Trunk
(Assignee)

Updated

5 years ago
Attachment #780039 - Flags: review?(pchang9)
Component: Untriaged → Spelling checker
Product: Firefox → Core
This patch might similarly need to be upstreamed: http://sourceforge.net/p/hunspell/bugs/

Comment 2

5 years ago
committed to hunspell HEAD now, thanks
Status: UNCONFIRMED → NEW
Ever confirmed: true
Whiteboard: [fixed-in-hunspell-1.3.3]
Depends on: 1022262
Attachment #780039 - Attachment is patch: true
Attachment #780039 - Flags: review?(pchang9)
Fixed on mozilla-central by bug 1022262.
Status: NEW → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla33
Assignee: nobody → pchang9
You need to log in before you can comment on or make changes to this bug.