bigeasy / bigeasy/timezone

Experiment with switch statement.

Open
#98 0 comments 0 reactions 1 assignee Claimed by @bigeasy View on GitHub
enhancement
Dominant language
JavaScript
Stars
256
Forks
26
PR merge metrics
No merged PRs in 30d

Description

We might get better performance from a switch statement than from the function invocation. The only way to know for sure is through an implementation an testing. The switch statement ought not increase the size beyond what it is already.

It is possible that using a switch statement that uses only integers, in order, will create a branch table in one of the JavaScript engines, resulting in better performance. Chrome seems to do this.

As our default action, we'd have to check for an extension function, if we continue to support extension functions, which I believe we will continue to do.

Using a switch statement with a testless for loop might give us the ability to process format modifiers easily, not paying for the cost beyond the cost of already testing to see if the specifier is valid. This short circuit might already exist.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.