Package cern.colt.map

Examples of cern.colt.map.AbstractLongObjectMap


        time = System.currentTimeMillis() - time;
        return time;
    }

    private static long testByte() {
        AbstractLongObjectMap tx = new OpenLongObjectHashMap(NUM);
        for (int i = 0; i < NUM; i++) {
            tx.put(i, new ConcurrentSkipListSet<ByteEntry>());
        }
        for (int i = 0; i < NUM; i++) {
            for (int j = 0; j < NUM; j++) {
                if (i == j) continue;
                if (Math.random() < FRACTION) {
                    ByteBuffer key = ByteBuffer.allocate(16);
                    key.putLong(5).putLong(j).flip();
                    ByteBuffer value = ByteBuffer.allocate(4);
                    value.putInt(random.nextInt(ROUNDSIZE)).flip();
                    ((ConcurrentSkipListSet<ByteEntry>) tx.get(i)).add(new ByteEntry(key, value));
                }
            }
        }
        long time = System.currentTimeMillis();
        long sum = 0;
View Full Code Here


        System.out.println(Runtime.getRuntime().freeMemory() / 1024);
        long memBefore = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
        System.out.println(memBefore / 1024);
        size = 10000000;
        final int modulo = 7;
        final AbstractLongObjectMap map = new OpenLongObjectHashMap(size);
        for (int i = 1; i <= size; i++) {
            map.put(size, "O" + i);
        }
        time = System.currentTimeMillis();
        map.forEachPair(new LongObjectProcedure() {
            @Override
            public boolean apply(long l, Object o) {
                if (l % modulo == 0) {
                    map.put(l, "T" + l);
                }
                return true;
            }
        });
        System.out.println("Time: " + (System.currentTimeMillis() - time));
View Full Code Here

TOP

Related Classes of cern.colt.map.AbstractLongObjectMap

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.