Skip to content

research: alternative to string for decimal conversion #392

Closed

Description

@DaveSkender

I had a quick test. And this way has max 3x performance gain!

    if cs_decimal is not None:
        return CsDecimal.ToDouble(cs_decimal)

But few tests fail due to precision problem

Originally posted by @LeeDongGeon1996 in #386 (comment)

Activity

  1. DaveSkender commented on Aug 11, 2024

    @DaveSkender
    MemberAuthor

    This is worth exploring IMO given the risk vs. reward tradeoff; though, we should check it out to see if precision loss from converting through double to decimal is significant compared to current string based conversion. See prior discussion on Precisions v. Performance of decimal vs double.

  2. added
    question
    and removed
    question
    on Sep 2, 2024
  3. DaveSkender commented on Aug 22, 2026

    @DaveSkender
    MemberAuthor

    Answered — closing.

    The faster conversion path this issue was researching shipped in #439 ("perf: Use 4x faster decimal conversion method across all indicators"), merged 2026-05-13. It preserved to_pydecimal_via_double for the ~4x gain and updated every indicator getter to use it.

    The blocker recorded here — "few tests fail due to precision problem" — is resolved: #439 landed with 583 tests passing, and #431 added dedicated performance tests for CsObject conversion to guard the path.

  4. locked as resolved and limited conversation to collaborators on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions