Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
3991b8ac
Commit
3991b8ac
authored
Aug 14, 2007
by
Bradley C. Kuszmaul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Speed up keycompare (maybe)
git-svn-id:
file:///svn/tokudb@131
c7de825b-a66e-492c-adef-691d508d4ae1
parent
2f28431c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
newbrt/key.c
newbrt/key.c
+17
-4
No files found.
newbrt/key.c
View file @
3991b8ac
...
...
@@ -19,8 +19,7 @@ int keycompare (bytevec key1b, ITEMLEN key1len, bytevec key2b, ITEMLEN key2len)
return 0;
}
#else
#if 0
#elsif 0
int keycompare (bytevec key1, ITEMLEN key1len, bytevec key2, ITEMLEN key2len) {
if (key1len==key2len) {
return memcmp(key1,key2,key1len);
...
...
@@ -32,7 +31,8 @@ int keycompare (bytevec key1, ITEMLEN key1len, bytevec key2, ITEMLEN key2len) {
return -keycompare(key2,key2len,key1,key1len);
}
}
#else
#elif
1
int
keycompare
(
bytevec
key1
,
ITEMLEN
key1len
,
bytevec
key2
,
ITEMLEN
key2len
)
{
if
(
key1len
==
key2len
)
{
return
memcmp
(
key1
,
key2
,
key1len
);
...
...
@@ -46,7 +46,20 @@ int keycompare (bytevec key1, ITEMLEN key1len, bytevec key2, ITEMLEN key2len) {
else
return
-
1
;
}
}
#endif
#else
int
keycompare
(
bytevec
key1
,
ITEMLEN
key1len
,
bytevec
key2
,
ITEMLEN
key2len
)
{
int
comparelen
=
key1len
<
key2len
?
key1len
:
key2len
;
const
unsigned
char
*
k1
;
const
unsigned
char
*
k2
;
for
(
k1
=
key1
,
k2
=
key2
;
comparelen
>
0
;
k1
++
,
k2
++
)
{
if
(
*
k1
!=
*
k2
)
{
return
(
int
)
*
k1
-
(
int
)
*
k2
;
}
}
return
key1len
-
key2len
;
}
#endif
void
test_keycompare
(
void
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment