Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于mappedByteBuffer.force();的问题 #11

Open
GoogleCodeExporter opened this issue Apr 18, 2016 · 0 comments
Open

关于mappedByteBuffer.force();的问题 #11

GoogleCodeExporter opened this issue Apr 18, 2016 · 0 comments

Comments

@GoogleCodeExporter
Copy link

直接拿项目介绍里的代码跑了一下  WINDOWS系统 设了1G内存 
写1024字节  
发现LogEntity里调用mappedByteBuffer.force();操作,有时候巨卡,多�
��时候达到1分多钟 求解
public static void main(String[] args) throws Exception {
        FQueue fQueue = new FQueue("/home/q/db/");
        StringBuilder sb = new StringBuilder();
        int length = Integer.parseInt(args[0]);
        for (int i = 0; i < length; i++) {
            sb.append("a");
        }
        byte[] data = sb.toString().getBytes();
        fQueue.add(data);// 预热一下
        long start = System.currentTimeMillis();
        for (int i = 0; i < 100000000; i++) {
            fQueue.add(data);
        }
        System.out.println(100000000.0 / ((System.currentTimeMillis() - start) / 1000) + "qps");
        fQueue.close();
    }


Original issue reported on code.google.com by sunrong...@gmail.com on 20 Jan 2015 at 8:56

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant