-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The binsearch C function now branches on double and integer types, so no conversion is done if 'key' and 'vec' are the same type. Cast both to double if they're not the same type. Create a struct that contains int and double fields, so we can pass it to a generic compare function. Create 4 compare functions, one for each type/start combination. All these components are static inline, with the hope the compiler can optimize them. Removing the as.double() call means ISO-8601 range-based subsetting is nearly twice as fast for integer vectors and keys. See #100.
- Loading branch information
1 parent
7463da7
commit 421366c
Showing
2 changed files
with
86 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters