bodar / totallylazy.js

TotallyLazy.js
Apache License 2.0
8 stars 5 forks source link

date parsing performance decrease since version 0.463.305 #28

Open philwhiteuk opened 1 year ago

philwhiteuk commented 1 year ago

Benchmarking date parsing on version 0.463.305 compared with version 0.505.347:

    it("performs well", function () {
        this.timeout(4_000);

        const now = date(2023, 1, 1);
        const oneHundredYears = 365 * 100;
        for (let i = 0; i < oneHundredYears; i++) {
            const date = Days.add(now, i);
            const dateText = format(date, 'en-GB', { day: '2-digit', month: 'short', year: 'numeric' });
            assert.deepEqual(parse(dateText, 'en-GB'), date);
        }
    });
philwhiteuk commented 1 year ago

@danielbodart I have run a javascript profiler on the date parse() method - comparison results here