Java : Syncronized는 어느정도의 시간이 걸릴까?

     

     

     

     

     

     

     

    Method 10 100 1000 1,000,000 10,000,000 100,000,000
    simpleFunctionWithoutLock 1ms 1ms 2ms 37ms 1.6s 20.9s
    simpleFunctionWithLock 0ms 0ms 1ms 20ms 0.7s 21.3s
    simpleFunctionWithLockSleep 106ms 1040ms 109700ms - - -

     

     

     

     

    Method 10 100 1,000 10,000 100,000 1,000,000 10,000,000 100,000,000
    putWithoutLock 1ms 1ms 3ms 9ms 34ms 217ms 2085ms 23558ms
    putWithLock 1ms 1ms 2ms 7ms 28ms 172ms 920ms 20060ms

     

     

     

    Method 10 100 1,000 10,000 100,000 1,000,000 10,000,000 100,000,000
    getWithoutLock 1ms 1ms 1ms 4ms 15ms 133ms 666ms 22408ms
    getWithLock 1ms 1ms 1ms 3ms 13ms 87ms 692ms 20697ms

    댓글

    Designed by JB FACTORY