Comments (3)
In most cases you can replace your use of HugeHashMap with ChronicleMap, could you try using ChronicleMap.
We are focusing most of our new development and support effort on ChronicleMap.
On 27 Oct 2014, at 10:49, Mesutcan Kurt [email protected] wrote:
I attached a profiler to my application and I saw that call tree:
https://cloud.githubusercontent.com/assets/439170/4789483/9a28a160-5dc5-11e4-9c8f-efffd151d9ba.png
I invoked Map.get() 8379 times and also net.openhft.collections.HugeHashMap$Segment.get is invoked same amount but Segment.getKey() is invoked 9.903.392 times.Why getKey() invocation count is more about 1000 times than Map.get() count?
My get code:
for (Long key : cache.keySet()) {
sr = cache.get(key);if (sr != null && sr.isDirty() && sr.isInDb()) { ++updateCount; sr.setClean(); try { cache.put(key, sr); } catch (Exception e) { // discard } }
}
—
Reply to this email directly or view it on GitHub #45.
from hugecollections-old.
If you want to iterate over the entries of any Map (not just ours) the most
efficient means is to use entrySet()
e.g.
for (Map.Entry<Long, SR> entry: cache.entrySet()) {
as you can see there is no need to lookup the entry via get()
BTW We have a means of efficiently persisting a Map to a JDBC connection,
perhaps you try this means of "replication"
On 27 October 2014 10:49, Mesutcan Kurt [email protected] wrote:
I attached a profiler to my application and I saw that call tree:
[image: image]
https://cloud.githubusercontent.com/assets/439170/4789483/9a28a160-5dc5-11e4-9c8f-efffd151d9ba.pngI invoked Map.get() 8379 times and also
net.openhft.collections.HugeHashMap$Segment.get is invoked same amount but
Segment.getKey() is invoked 9.903.392 times.Why getKey() invocation count is more about 1000 times than Map.get()
count?My get code:
for (Long key : cache.keySet()) {
sr = cache.get(key);if (sr != null && sr.isDirty() && sr.isInDb()) { ++updateCount; sr.setClean(); try { cache.put(key, sr); } catch (Exception e) { // discard } }}
—
Reply to this email directly or view it on GitHub
#45.
from hugecollections-old.
BTW This could happen if you HugeHashMap is very full. (i.e. it is heavily
loaded compared to it's capacity)
When this happens, you might find a very large number of lookups are
performed to find each key.
On 27 October 2014 10:49, Mesutcan Kurt [email protected] wrote:
I attached a profiler to my application and I saw that call tree:
[image: image]
https://cloud.githubusercontent.com/assets/439170/4789483/9a28a160-5dc5-11e4-9c8f-efffd151d9ba.pngI invoked Map.get() 8379 times and also
net.openhft.collections.HugeHashMap$Segment.get is invoked same amount but
Segment.getKey() is invoked 9.903.392 times.Why getKey() invocation count is more about 1000 times than Map.get()
count?My get code:
for (Long key : cache.keySet()) {
sr = cache.get(key);if (sr != null && sr.isDirty() && sr.isInDb()) { ++updateCount; sr.setClean(); try { cache.put(key, sr); } catch (Exception e) { // discard } }}
—
Reply to this email directly or view it on GitHub
#45.
from hugecollections-old.
Related Issues (20)
- setSegments(int) is not public in HugeConfig; cannot be accessed from outside package HOT 3
- Comparing behaviour of HugeHashMap with HashMap HOT 2
- custom marshalling/serialization HOT 16
- remark on replication/distribution HOT 9
- how to get exactly 1 OpenHFT test to run HOT 10
- Using Shared/HugeHashMap HOT 3
- PingPong latency test across /dev/shm/SharedHashMap IPC ... HOT 19
- support for "read through" and "write behind" gettr/settrs (in addition to JBI) HOT 25
- Cache size exceed bug HOT 1
- TCPSocketReplication4WayMapTest testBufferOverflow failed (Windows 8.1) HOT 10
- VanillaShortShortMultiMap is full when capacity is still available HOT 5
- Difference between setSmallEntrySize and setCapacity
- SharedHashMap: iterating using keyset, valueset is very slow for larger tables HOT 8
- problem using SharedHashMapBuilder ... HOT 6
- OpenHFT scope of capability re: SHMEntry fields (user JBI supplied) and "barrier" operations HOT 9
- HugeHashMap with JPA elements HOT 4
- SharedHashMap causing crash on Windows OS HOT 28
- Chronicle Map not thread-safe in certain circumstances HOT 14
- ChronicleMap / ChronicleMapBuilder - actualEntriesPerSegment restricted to minimum of 8 HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hugecollections-old.