1 /*******************************************************************************
2 * Copyright (c) 2007 VTT Technical Research Centre of Finland and others.
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * VTT Technical Research Centre of Finland - initial API and implementation
10 *******************************************************************************/
11 package org.simantics.databoard.tests;
13 import java.util.concurrent.locks.ReentrantReadWriteLock;
15 import org.simantics.databoard.Bindings;
16 import org.simantics.databoard.binding.Binding;
18 public class Jotakin6 {
20 public static class X {
21 public int[] array = new int[1024*1024*4];
22 public long[] array2 = new long[1024*1024*4];
25 public static class Y {
28 public static void main(String[] args)
31 ReentrantReadWriteLock lock = new ReentrantReadWriteLock();
33 lock.writeLock().lock();
34 lock.readLock().lock();
35 lock.readLock().unlock();
36 lock.writeLock().unlock();
39 Binding b = Bindings.getBinding(X.class);
41 int hash = b.hashValue(x);
43 long startTime = System.currentTimeMillis();
45 hash = b.hashValue(x);
47 long elapsedTime = System.currentTimeMillis() - startTime;
49 System.out.println("hash="+hash+", time="+elapsedTime);