Giter Club home page Giter Club logo

Comments (1)

zeon256 avatar zeon256 commented on May 25, 2024

Improved ser_route

de_route                time:   [998.75 us 999.01 us 999.33 us]                      
                        change: [+9.6764% +10.537% +11.255%] (p = 0.00 < 0.05)
                        Performance has regressed.
Found 14 outliers among 100 measurements (14.00%)
  1 (1.00%) low severe
  1 (1.00%) low mild
  4 (4.00%) high mild
  8 (8.00%) high severe

ser_route               time:   [869.72 us 885.96 us 904.44 us]                      
                        change: [-33.452% -31.768% -29.834%] (p = 0.00 < 0.05)
                        Performance has improved.

        pub fn deserialize<'de, D>(deserializer: D) -> Result<Option<NaiveTime>, D::Error>
        where
            D: Deserializer<'de>,
        {

            let s: Rc<String> = Rc::new( String::deserialize(deserializer)?);
            let is_broken = &*s;
            if is_broken.eq("-") {
                return Ok(None);
            }

            let time_res = NaiveTime::parse_from_str(&s, FORMAT);

            match time_res {
                Ok(r) => Ok(Some(r)),
                Err(_) => {
                    let s2 = s.clone();
                    let chars = s.chars();
                    let chars2 = s2.chars();
                    let hr = chars.take(2).collect::<String>().parse().unwrap();
                    let min = chars2.take(4).collect::<String>().parse().unwrap();
                    let time = NaiveTime::from_hms_opt(hr,min,0);
                    Ok(time)
                }
            }
        }

from lta-rs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.