- Notifications
You must be signed in to change notification settings - Fork79
Date and "empty objects" that are not objects.#35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Add support for Date objects and "empty objects" that are not objects.Uses obj.toString() to display the object.
hi, thanks for your patch! just some observations, did you changed to ifs only to use bitmasks? why not just introduce another constant for special objects and keep the switch? I'm using this lib in a performance sensitive place (hundreds of potentially big objects) and when I update this lib, if my benchmarks show that the if is slower I will revert back to a switch statement. just want to know if there's a performance reason that I don't know of (I would expect switch to be optimized to a jump table but the "if" solution not, but maybe there's an optimization I'm not aware of) |
I chose if..else-if..else because it was more sraight-forward when dealing with bitmasks. I've put together aperf test which compares the isolated bitmask-in-switch and bitmask-in-if behaviour and the difference is minimal. |
Date and "empty objects" that are not objects.
ok, thanks for the perf test and the patch! |
Add support for Date objects and "empty objects" that are not objects.
Uses obj.toString() to display the object.
Also convert "CONSTANTS" to bebitmask-compatible and replace
switch
statement withif
statement in order to be able to use bitmasks.