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

[WIP] Fix large resnumber #30

Closed
wants to merge 5 commits into from
Closed

[WIP] Fix large resnumber #30

wants to merge 5 commits into from

Commits on Mar 13, 2019

  1. [WIP] NODEおよびLAYOUTの配列を動的配列にする

    長大なスレッド(>11000レス?)を開くと落ちる不具合を修正する](https://github.com/JDimproved/JDim/projects/1#card-18008854
    
    EDIT: レス番号へ移動が動作しない問題を修正する
    taro-yamada authored and ma8ma committed Mar 13, 2019
    Configuration menu
    Copy the full SHA
    c81d69c View commit details
    Browse the repository at this point in the history
  2. [WIP] update_id_name()の速度改善

    taro-yamada authored and ma8ma committed Mar 13, 2019
    Configuration menu
    Copy the full SHA
    a037628 View commit details
    Browse the repository at this point in the history

Commits on Mar 14, 2019

  1. [WIP] Use std::unordered_set instead of std::vector for res information

    レス数の上限を取り除くためstd::vector<char>で管理しているしおりなど
    のレス情報をレス番号(int)をキーにしたstd::unordered_set<int>で管理する。
    unordered_setは初期化の際にkExpectedResInfo(=512)のサイズに予約する。
    
    修正の根拠
    しおり、書き込み、返信などのマークはレス数に対して十分少なくなるはず。
    したがってstd::vectorでレス数と同じサイズの領域を確保する必要性は低い。
    
    パフォーマンスの影響
    挿入時にハッシュ計算(レス番号=int)のコストがかかる。また、最悪の場合
    ハッシュの再計算やメモリの再確保が発生する(kExpectedResInfoで調整可能)。
    レス番号の順序が必要な箇所があるが実行される条件は限られているので
    std::set<int>の一時変数を使っている。
    ma8ma committed Mar 14, 2019
    Configuration menu
    Copy the full SHA
    8c5cd05 View commit details
    Browse the repository at this point in the history
  2. [WIP] Eliminate MAX_RESNUMBER

    MAX_RESNUMBERを取り除いてレス数の上限を1048576(2の20乗)に引き上げる
    合わせて7桁までのレスアンカーを有効にする
    また、レス番号を表現する符号付き整数はsizeof(int) >= 4以上を要件とする
    
    新たに導入する定数
    kMaxResNumber は設定可能な最大レス数(=1048576) : 設定の上限に使われる
    kExptectedResNumber は最大レス数の想定値(=11000) : メモリ確保に使われる
    ma8ma committed Mar 14, 2019
    Configuration menu
    Copy the full SHA
    461abb6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    47960fe View commit details
    Browse the repository at this point in the history