Skip to content

Attemp to Improve Dict Complile Performance#663

Merged
lotem merged 5 commits into
rime:masterfrom
WhiredPlanck:dict-complile-performance
Jun 23, 2023
Merged

Attemp to Improve Dict Complile Performance#663
lotem merged 5 commits into
rime:masterfrom
WhiredPlanck:dict-complile-performance

Conversation

@WhiredPlanck
Copy link
Copy Markdown
Contributor

@WhiredPlanck WhiredPlanck commented Jun 13, 2023

Pull request

Issue tracker

Fixes will automatically close the related issue

Fixes # N/A

Feature

Describe feature of pull request

This PR uses several techniques to try to improve the speed of compiling dictionaries. It may save 8 ~ 10 % of build time of the dictionaries.

Unit test

  • Done

Manual test

  • Done

Code Review

  1. Unit and manual test pass
  2. GitHub Action CI pass
  3. At least one contributor reviews and votes
  4. Can be merged clean without conflicts
  5. PR will be merged by rebase upstream base

Additional Info

Tested schema: rime-ice
Compiler: GCC 13.1.1
OS: Arch Linux x86_64

Before

(Script)Encoder::DfsEncoder takes about 53% of the build time to run before the optimization.

a1

After

By speeding up EntryColletor::TranslateWord, (Script)Encoder::DfsEncoder takes about 45% of the build time to run, about 8% shorter than before.

b1

- Replace map with unordered_map for related data structs
- Replace boost::lexicast to std::stox

This may save 8 % ~ 10 % of the build time of the dictionaries.
@WhiredPlanck WhiredPlanck force-pushed the dict-complile-performance branch from b3d2a5a to f65ea12 Compare June 14, 2023 07:11
Comment thread src/rime/algo/strings.h Outdated
Comment thread src/rime/algo/strings.cc
@lotem lotem merged commit bd3c7c7 into rime:master Jun 23, 2023
@WhiredPlanck WhiredPlanck deleted the dict-complile-performance branch June 28, 2023 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants