Skip to content

Commit 9c4cebb

Browse files
Make directory names more readable.
1 parent eb76c8c commit 9c4cebb

File tree

10 files changed

+28
-29
lines changed

10 files changed

+28
-29
lines changed

examples/map/README.md

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
# map examples
22

3-
## OnHeapDemo
3+
## onheap
44

55
* Put 20,000 CacheObject instances into a ConcurrentHashMap.
66
* Each CacheObject instance contains a random string of length 500KB.
77
* This is a total of 10 GB of data stored on the normal Java heap.
88
* This application does not make use of any features of the native_memory_allocator library. It is provided for
99
comparison with NativeMemoryMap demos using off-heap storage.
1010

11-
## OffHeapDemo
11+
## offheap
1212

13-
* Put 20,000 CacheObject instances into a NativeMemoryMap.
14-
* This demo uses the ConcurrentHashMap backend for NativeMemoryMap, which does not support eviction.
15-
* Each CacheObject instance contains a random string of length 500KB.
16-
* This is a total of 10 GB of data in off-heap memory.
13+
* Same as onheap but uses NativeMemoryMap with off-heap storage.
14+
* Uses the ConcurrentHashMap backend for NativeMemoryMap, which does not support eviction.
15+
* Total of 10 GB of data in off-heap memory.
1716

18-
## OffHeapDemoWithEviction
17+
## offheap-eviction
1918

20-
* Same as OffHeapDemo but uses the Caffeine backend with maximumSize of 10,000 entries.
19+
* Same as offheap but uses the Caffeine backend with maximumSize of 10,000 entries.
2120
* Expect 10,000 entries at end of run with 10,000 total evictions.
2221

23-
## OffHeapDemoWithEvictionAndOperationCounters
22+
## offheap-eviction-operationcounters
2423

25-
* Same as OffHeapDemoWithEviction but enables operation counters and logs them at the end of the demo.
24+
* Same as offheap-eviction but enables operation counters and logs them at the end of the demo.
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.target.nativememoryallocator.examples.map.offheapdemowithevictionandoperationcounters
1+
package com.target.nativememoryallocator.examples.map.offheap.eviction.operationcounters
22

33
import com.target.nativememoryallocator.allocator.NativeMemoryAllocatorBuilder
44
import com.target.nativememoryallocator.examples.map.utils.CacheObject
@@ -14,9 +14,9 @@ private val logger = KotlinLogging.logger {}
1414

1515

1616
/**
17-
* Same as OffHeapDemoWithEviction but enables operation counters
17+
* Same as OffHeapEviction but enables operation counters
1818
*/
19-
private class OffHeapDemoWithEvictionAndOperationCounters {
19+
private class OffHeapEvictionOperationCounters {
2020

2121
private val numEntries = 20_000
2222

@@ -90,6 +90,6 @@ private class OffHeapDemoWithEvictionAndOperationCounters {
9090

9191
suspend fun main() {
9292
withContext(Dispatchers.Default) {
93-
OffHeapDemoWithEvictionAndOperationCounters().run()
93+
OffHeapEvictionOperationCounters().run()
9494
}
9595
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.target.nativememoryallocator.examples.map.offheapdemowitheviction
1+
package com.target.nativememoryallocator.examples.map.offheap.eviction
22

33
import com.target.nativememoryallocator.allocator.NativeMemoryAllocatorBuilder
44
import com.target.nativememoryallocator.examples.map.utils.CacheObject
@@ -14,9 +14,9 @@ private val logger = KotlinLogging.logger {}
1414

1515

1616
/**
17-
* Same as OffHeapDemo but uses the Caffeine backend with maximumSize of 10,000 entries.
17+
* Same as OffHeap but uses the Caffeine backend with maximumSize of 10,000 entries.
1818
*/
19-
private class OffHeapDemoWithEviction {
19+
private class OffHeapEviction {
2020

2121
private val numEntries = 20_000
2222

@@ -87,6 +87,6 @@ private class OffHeapDemoWithEviction {
8787

8888
suspend fun main() {
8989
withContext(Dispatchers.Default) {
90-
OffHeapDemoWithEviction().run()
90+
OffHeapEviction().run()
9191
}
9292
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.target.nativememoryallocator.examples.map.offheapdemo
1+
package com.target.nativememoryallocator.examples.map.offheap
22

33
import com.target.nativememoryallocator.allocator.NativeMemoryAllocatorBuilder
44
import com.target.nativememoryallocator.examples.map.utils.CacheObject
@@ -22,9 +22,9 @@ private val logger = KotlinLogging.logger {}
2222
*
2323
* This is a total of 10 GB of data in off-heap memory.
2424
*
25-
* OnHeapDemo is the same application using normal on-heap storage for comparison.
25+
* OnHeap is the same application using normal on-heap storage for comparison.
2626
*/
27-
private class OffHeapDemo {
27+
private class OffHeap {
2828

2929
private val numEntries = 20_000
3030

@@ -88,6 +88,6 @@ private class OffHeapDemo {
8888

8989
suspend fun main() {
9090
withContext(Dispatchers.Default) {
91-
OffHeapDemo().run()
91+
OffHeap().run()
9292
}
9393
}
File renamed without changes.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.target.nativememoryallocator.examples.map.onheapdemo
1+
package com.target.nativememoryallocator.examples.map.onheap
22

33
import com.target.nativememoryallocator.examples.map.utils.CacheObject
44
import com.target.nativememoryallocator.examples.map.utils.buildRandomString
@@ -19,7 +19,7 @@ private val logger = KotlinLogging.logger {}
1919
* This application does not make use of any features of the native_memory_allocator library.
2020
* It is provided for comparison with off-heap demos.
2121
*/
22-
private class OnHeapDemo {
22+
private class OnHeap {
2323

2424
private val numEntries = 20_000
2525

@@ -70,6 +70,6 @@ private class OnHeapDemo {
7070

7171
suspend fun main() {
7272
withContext(Dispatchers.Default) {
73-
OnHeapDemo().run()
73+
OnHeap().run()
7474
}
7575
}

settings.gradle.kts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ include(
44
"examples",
55
"examples:map",
66
"examples:map:utils",
7-
"examples:map:onheapdemo",
8-
"examples:map:offheapdemo",
9-
"examples:map:offheapdemowitheviction",
10-
"examples:map:offheapdemowithevictionandoperationcounters",
7+
"examples:map:onheap",
8+
"examples:map:offheap",
9+
"examples:map:offheap-eviction",
10+
"examples:map:offheap-eviction-operationcounters",
1111
)

0 commit comments

Comments
 (0)