小编ura*_*rag的帖子

Java填充性能破坏

嗨,大家好,所以我得到了这段代码

public class Padding {

  static class Pair {

        volatile long c1;
        // UN-comment this line and see how perofmance is boosted * 2
      //  long q1; //Magic dodo thingy

        volatile long c2;

  }

  static Pair p = new Pair();

  static class Worker implements Runnable {

        private static final int INT = Integer.MAX_VALUE/8;
        private boolean b;
        Worker(boolean b) {
              this.b = b;
        }

        public void run() {
              long start = System.currentTimeMillis();
              if (b) {
                    for (int i = 0; i …
Run Code Online (Sandbox Code Playgroud)

java performance multithreading false-sharing

2
推荐指数
1
解决办法
256
查看次数

减少需求.txt

有没有办法减少我的requirements.txt 我一年前改用Python,那时我还没有完全理解事情是如何工作的。所以当我需要创建 requirements.txt 时,我只是做了一个 pip freeze 并复制通过了所有的要求。今天我知道我不需要它们都只是顶级的导入其他要求有没有办法实现它?

python requirements.txt

1
推荐指数
1
解决办法
1156
查看次数