tracker
All repositories: gitoria
1.1 KB
// Growth, colliding keys, misses and owner replacement in the packed lookup.import PackedOwners from '../lib/shortid-owners.hl'static alphabet = 'abcdefghijklmnopqrstuvwxyz0123456789'static sidOf = (Number number) => {let n = numberlet sid = ''let i = 0while (i < 5) {sid = alphabet[n % 36] + sidn = (n - n % 36) / 36i = i + 1}return sid}static verify = () => {owners = new PackedOwners()let i = 0while (i < 5000) {owners.put(sidOf(i * 1024), 'sowner-' + i)i = i + 1}if (owners.count != 5000) { hlError('lost owner count') }let j = 0while (j < 5000) {if (owners.fetch(sidOf(j * 1024)) != 'sowner-' + j) { hlError('lost owner ' + j) }j = j + 1}if (owners.fetch('zzzzz') != null) { hlError('unknown short id is owned') }owners.put(sidOf(0), 'pAny-length-UTF8-é-owner')if (owners.fetch(sidOf(0)) != 'pAny-length-UTF8-é-owner' || owners.count != 5000) { hlError('owner replacement failed') }owners.put('zzzzz', 'sLast')if (owners.fetch('zzzzz') != 'sLast') { hlError('claim after growth failed') }console.log('packed owners: 5000 colliding keys, growth, every lookup, miss, replacement, UTF-8 and new claim passed')return true}verify()
Branches
Latest commits
- 9332bd10log: DP70 livemre
- be11daa0DP70 brief fixmre
- 886a7028DP70 brief, HM67 mergedmre
- b41cdd6dMerge hm67-searchids: packed search IDsmre
- 385904eaReport HM67 matched heap measurements and gate proofmre
- e5c9b659Pack retained search IDs into UTF-8 bytesmre
- 62a5f6c7HM67 brief, HM66 mergedmre
- b32b8440Merge hm66-catalogindex: packed catalog indexmre
- 2db0f7adReport HM66 heap measurements and validationmre
- 6ce15623Pack catalog lists and membership maps in UTF-8 bytesmre
- 71134e21HM66 briefmre
- ed4cbab2status timemre
- e982c26dlog: HM65 mergedmre
- 6e72f9d1Merge hm65-fields: episode boot scan reads three fieldsmre
- 07a5c883HM65 report measured field projection and complete validationmre
- 0eab858fRead only catalog date fields during the episode boot scanmre
- d3179273log: HM65 hl:heap vendoringmre
- cb78a1a0HM65 report missing heap diagnostic package with repromre
- 89606a5cHM65 briefmre
- 096ce0d4log: DP69 live on day48mre