Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
dayjs vs luxon between
(version: 0)
Comparing performance of:
luxon vs dayjs
Created:
one year ago
by:
Guest
Jump to the latest result
HTML Preparation code:
<script src="https://cdn.jsdelivr.net/npm/dayjs@1.11.11/dayjs.min.js"></script> <script src="https://cdn.jsdelivr.net/npm/dayjs@1.11.11/plugin/timezone.js"></script> <script src="https://cdn.jsdelivr.net/npm/dayjs@1.11.11/plugin/utc.js"></script> <script src="https://cdn.jsdelivr.net/npm/dayjs@1.11.11/plugin/isBetween.js"></script> <script src="https://cdn.jsdelivr.net/npm/luxon@1.28.0/build/global/luxon.min.js"></script>
Script Preparation code:
dayjs.extend(window.dayjs_plugin_utc) dayjs.extend(window.dayjs_plugin_timezone) dayjs.extend(window.dayjs_plugin_isBetween) window.__start__ = '2024-04-30 08:33'; window.__end__ = '2024-05-30 08:33'; window.__timezone__ = 'Europe/Warsaw'; window.__luxon__ = luxon; window.__dayjs__ = dayjs;
Tests:
luxon
const start = __luxon__.DateTime.fromFormat(__start__, 'yyyy-MM-dd HH:mm', { zone: __timezone__ }); const end = __luxon__.DateTime.fromFormat(__end__, 'yyyy-MM-dd HH:mm', { zone: __timezone__ }); const current = __luxon__.DateTime.now().setZone(__timezone__); const currentValue = current.startOf('minute').valueOf(); currentValue >= start.valueOf() && currentValue <= end.valueOf();
dayjs
const start = __dayjs__.tz(__start__, 'YYYY-MM-DD HH:mm', __timezone__); const end = __dayjs__.tz(__end__, 'YYYY-MM-DD HH:mm', __timezone__); const current = __dayjs__().tz(__timezone__); current.isBetween(start, end, 'minute', []);
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
luxon
dayjs
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
one year ago
)
User agent:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/130.0.0.0 Safari/537.36
Browser/OS:
Chrome 130 on Windows
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
luxon
5703.5 Ops/sec
dayjs
1642.8 Ops/sec
Autogenerated LLM Summary
(model
llama3.2:3b
, generated one year ago):
**Overview** The provided benchmark compares the performance of two JavaScript libraries, Luxon and Day.js, for handling date and time operations in a specific use case: calculating whether a current moment falls within a given time range. **Options Compared** Two options are compared: 1. **Luxon**: A modern JavaScript date library that provides a powerful API for working with dates and times. 2. **Day.js**: A lightweight, easy-to-use JavaScript date library that aims to provide a simple alternative to popular libraries like Luxon. **Pros and Cons of Each Approach** * **Luxon:** + Pros: - More comprehensive set of features (e.g., timezone management, internationalization) - Better suited for complex date calculations - More flexible API + Cons: - Heavier than Day.js (more dependencies) - Steeper learning curve due to its feature-rich API * **Day.js:** + Pros: - Lightweight and easy to use - Simple, intuitive API - Fast execution times + Cons: - Limited features compared to Luxon (e.g., no timezone management) - May not be suitable for complex date calculations **Library and Purpose** * **Luxon**: Developed by Oliver Barrett, Luxon is a modern JavaScript date library that provides a powerful API for working with dates and times. It includes features like timezone management, internationalization, and formatting. * **Day.js**: Developed by John Resig (also known for jQuery), Day.js is a lightweight, easy-to-use JavaScript date library that aims to provide a simple alternative to popular libraries like Luxon. **Special JS Features or Syntax** None mentioned in the provided benchmark definitions. However, it's worth noting that Luxon and Day.js both support modern JavaScript features like async/await and promises. **Other Alternatives** * **Moment.js**: A popular JavaScript date library that provides a wide range of features for working with dates and times. * **Date-fns**: A lightweight, pure JavaScript library for working with dates and times. * **js-joda**: A JavaScript port of the popular Java library Joda-Time. These alternatives may be worth exploring depending on your specific use case and performance requirements.
Related benchmarks:
dayjs vs luxon vs js-joda vs date-fns (parsing)
dayjs vs luxon currentDate
dayjs vs luxon withTimezoneFromString
dayjs vs luxon timeToEnd
Comments
Confirm delete:
Do you really want to delete benchmark?