Closed Bug 1130317 Opened 5 years ago Closed 5 years ago
Dictionary] Pre-determine dict blob total byte length before building the blob
46 bytes, text/x-github-pull-request
|Details | Review|
In bug 1102834's user dictionary blob generation, the blob array grows dynamically as each byte is push()'ed into the array, which is later converted to a typed array. However, it should be possible that we pre-determine the length of the blob array and allocate a typed array of specific size and fill in the bytes directly on the typed array. We should investigate the possibility.
* For better performance, for sure.
On this. Target Milestone is set to S7 because S6's end-date is Chinese New Year.
Assignee: nobody → jlu
Target Milestone: --- → 2.2 S7 (6mar)
Will request for review after testing is good.
Status: NEW → ASSIGNED
(In reply to John Lu [:mnjul] [MoCoTPE] from comment #1) > * For better performance, for sure. A very rough JSPerf: http://jsperf.com/typed-array-push-or-predetermined
Comment on attachment 8561210 [details] [review] [PullReq] mnjul:bug_1130317_dict_blob_predetermine_length to mozilla-b2g:master Tim, Please check out the patch. The rationale behind this is pretty simple. No tests were modified as we blackbox-test WordListConverter, and its internal performance improvement patch should, of course, not have an impact on blob end-result. Thanks!
Attachment #8561210 - Flags: review?(timdream)
Attachment #8561210 - Flags: review?(timdream) → review+
Pull request has landed in master: https://github.com/mozilla-b2g/gaia/commit/c026f6d6b7a58fcc15a3164b37a1c9de788ce1e6
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: 2.2 S7 (6mar) → 2.2 S6 (20feb)
You need to log in before you can comment on or make changes to this bug.