Sign in to import from GitHub:
contributed by <litingyang
>
laochanlam
printf(" I am C ");
可以 lightlight 程式碼,使閱讀更舒服
Architecture: x86_64
CPU 作業模式: 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 4
On-line CPU(s) list: 0-3
每核心執行緒數:2
每通訊端核心數:2
Socket(s): 1
NUMA 節點: 1
供應商識別號: GenuineIntel
CPU 家族: 6
型號: 60
Model name: Intel(R) Core(TM) i5-4200H CPU @ 2.80GHz
製程: 3
CPU MHz: 1499.968
CPU max MHz: 3400.0000
CPU min MHz: 800.0000
BogoMIPS: 5587.02
虛擬: VT-x
L1d 快取: 32K
L1i 快取: 32K
L2 快取: 256K
L3 快取: 3072K
NUMA node0 CPU(s): 0-3
typedef struct __PHONE_BOOK_ENTRY {
char lastName[MAX_LAST_NAME_SIZE];
char firstName[16];
char email[16];
char phone[10];
char cell[10];
char addr1[16];
char addr2[16];
char city[16];
char state[2];
char zip[5];
struct __PHONE_BOOK_ENTRY *pNext;
} entry;
size of entry : 136 bytes
1,213,548 cache-misses # 85.624 % of all cache refs ( +- 0.34% )
1,417,297 cache-references ( +- 0.28% )
261,385,334 instructions # 1.38 insns per cycle ( +- 0.02% )
189,397,975 cycles ( +- 0.13% )
0.057404208 seconds time elapsed ( +- 0.56% )
typedef struct __PHONE_BOOK_ENTRY {
char lastName[MAX_LAST_NAME_SIZE];
struct more_info *more;
struct __PHONE_BOOK_ENTRY *pNext;
} entry;
typedef struct more_info {
char firstName[16];
char email[16];
char phone[10];
char cell[10];
char addr1[16];
char addr2[16];
char city[16];
char state[2];
char zip[5];
} detail;
size of entry : 32 bytes
154,240 cache-misses # 40.278 % of all cache refs ( +- 0.49% )
382,935 cache-references ( +- 0.41% )
244,279,089 instructions # 1.96 insns per cycle ( +- 0.02% )
124,542,326 cycles ( +- 0.13% )
0.037623995 seconds time elapsed ( +- 0.15% )
append 速度以及 findname 速度都有提昇
unsigned int hash(char lastName[])
{
unsigned int sum = 1;
while(*lastName) {
sum = ( sum + (sum << 2 + sum) * (*(lastName)) ) % MOD;
lastName++;
}
return sum;
}
150,124 cache-misses # 27.893 % of all cache refs ( +- 3.26% )
538,221 cache-references ( +- 0.34% )
271,223,334 instructions # 1.42 insns per cycle ( +- 0.02% )
191,212,278 cycles ( +- 0.34% )
0.057488312 seconds time elapsed ( +- 0.34% )
hash table size = 10007
append 速度下降而 findname 速度有明顯提昇
hash function
typedef struct __PHONE_BOOK_ENTRY {
int isword;
struct more_info *more;
struct __PHONE_BOOK_ENTRY *pNext[26];
} entry;
size of entry : 224 bytes
353,098 cache-misses # 68.819 % of all cache refs ( +- 0.52% )
513,080 cache-references ( +- 0.72% )
498,826,561 instructions # 1.46 insns per cycle ( +- 0.01% )
341,208,312 cycles ( +- 0.18% )
0.102322192 seconds time elapsed ( +- 0.20% )
記憶體的使用量大、node 數多,append 時間長,findname 時間少
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing