???: HashMap? ?? ??? ??? ???? ?? ??? ??? ? ??? ConcurrentHashMap? ?????? ?????. HashMap? ?? ??? ???? ??? ConcurrentHashMap? ?? ??? ???? ??? ??? ????.
? ????? ?? ??: Windows 7 ???, Java 10 ??, DELL G3 ???.
???? ?????? ???
HashMap? ???? ???? ????. ?? ??? ??? ???? ?? ??? ????? ConcurrentHashMap? ???? ?????.
HashMap? ?? ??? ???? ??? ??? ??? ????. ConcurrentHashMap? ?? ??? ???? ReentrantLock(JDK1.7 ??? ??)/CAS? ???? ???(JDK1.8 ?? ??)???. , ??? ??? ? ??? ????? ????. ??? ???? ? ????? ?????? ????? ?? ??? ???? ?????.
ConcurrentHashMap? ?? ?? ??? ???? ?? ?? ??? ?????. ?, ? ? ??? ?? ?? ?? ????? ??? ? ?? ?????? ??? ????. ?? ?? ??? ??? ? ?? ?? ????? ??? ???. ????? ??? ?? ? ????? ???? ?? ???? ??? ???? ???.
ConcurrentHashMap? ?? ???? ?? ???? ??? ??? ??? ??????.
(?? ????: java ?? ????)
HashMap
HashMap? ?? ???? put ???? ?? ?? ??? ???? ??? ?? ??? ?????. ??? ???? ?? ??? ????. run ????? for ??? ???? ?? 100?? ?? ??? ?? ????? ?? ??? ?????. ??? ??? 100??? ?? ???? 176? ?????.
class Demo implements Runnable{ static Map<String,String> map = new HashMap<>(); @Override public void run() { for (int i = 0; i < 100; i ++) { map.put(i + "","value"); } } public static void main(String[] args) { new Thread(new Demo()).start(); new Thread(new Demo()).start(); new Thread(new Demo()).start(); // 獲取當前線程 Thread currentThread = Thread.currentThread(); // 當前線程睡眠2秒,讓上面的三個線程先執(zhí)行 try { currentThread.sleep(2000); } catch (Exception e) { e.getMessage(); } // 上面的線程執(zhí)行完畢后輸出map的大小 System.out.println(map.size()); } }
HashTable
HashTable? ??? ????, ??? put ???? ?? ????? ?? ???? ?? ??? ???? ??? ???? ??????. ??? put10000? ??????. ???? ???? ??, ?? ??? ??? 10,000??, ??? ? 16ms? ???? ? ? ????.
class Demo implements Runnable{ static Map<String,String> map = new Hashtable<>(); @Override public void run() { long startTime = System.currentTimeMillis(); //獲取開始時間 for (int i = 0; i < 10000; i ++) { map.put(i + "","value"); } long endTime = System.currentTimeMillis(); //獲取結束時間 System.out.println((endTime - startTime) + "ms"); } public static void main(String[] args) { new Thread(new Demo()).start(); new Thread(new Demo()).start(); new Thread(new Demo()).start(); // 獲取當前線程 Thread currentThread = Thread.currentThread(); // 當前線程睡眠2秒,讓上面的三個線程先執(zhí)行 try { currentThread.sleep(2000); } catch (Exception e) { e.getMessage(); } // 上面的線程執(zhí)行完畢后輸出map的大小 System.out.println(map.size()); } }
ConcurrentHashMap
ConcurrentHashMap? ??? ?? ??? ?????. ???? ?? ??? ??? ???? ?? ?? ? ??? ????. ????! ? ?? ??? ??? ???? ??? ??? ?????.
class Demo implements Runnable{ static Map<String,String> map = new ConcurrentHashMap<>(); @Override public void run() { long startTime = System.currentTimeMillis(); //獲取開始時間 for (int i = 0; i < 10000; i ++) { map.put(i + "","value"); } long endTime = System.currentTimeMillis(); //獲取結束時間 System.out.println((endTime - startTime) + "ms"); } public static void main(String[] args) { new Thread(new Demo()).start(); new Thread(new Demo()).start(); new Thread(new Demo()).start(); // 獲取當前線程 Thread currentThread = Thread.currentThread(); // 當前線程睡眠2秒,讓上面的三個線程先執(zhí)行 try { currentThread.sleep(2000); } catch (Exception e) { e.getMessage(); } // 上面的線程執(zhí)行完畢后輸出map的大小 System.out.println(map.size()); } }
???? ? ? ??? ?? 20ms, 22ms?? ?? 17ms, 18ms? ???????
? ?? ??? ????? ?? ??? ??? ????? ???? ?????! !
? ??? ???? ?? ???? ???? ?????? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

JDBC ????? ???? ????? ?? ?? ?? ??? ?? ?? ??? ?? ? ?? ??? ?? ?? ?? ??? ???????. 1. ????? ????? Conn.SetAutoCommit (False)?? ??????. 2. ??? ? ????? ?? ?? SQL ??? ?????. 3. ?? ??? ??? ?? Conn.commit ()?? ???? ??? ???? ???? ?? ??? ???? Conn.Rollback ()?? ??????. ???, ? ??? ???? ????, ??? ???? ????, ?? ??? ??? ?? ??? ??? ???? ? ???????. ?? ?? ?? ???? ????? ??? ???? ?? ?? ???? ???? ??? ????? ?? ??? ??? ? ?? ???? ?? ????.

?? ?? ? ?? ???? ???? ?? Java.Time ???? ???? ??????. 2. LocalDate, LocalDateTime ? LocalTime? ?? ?? ??? ??? ?????. 3. () ???? ???? ?? ??? ??? ????. 4. ???/???? ??? ???? ??? ????? ??? ??????. 5. ZonedDateTime ? Zoneid? ???? ???? ??????. 6. DateTimeFormatter? ?? ?? ? ?? ?? ?? ???; 7. ??? ?? ?? ?? ??? ????? ?? ??????. ?? Java? ?? ??? ???? ??? ??? ???? Java.Timeapi ??? ?? ??? ???????.

Pre-FormancetArtUptimeMoryUsage, Quarkusandmicronautleadduetocompile-timeprocessingandgraalvsupport, withquarkusoftenperforminglightbetterine serverless sinarios.2.thyvelopecosyste,

NetworkPortSandfirewallsworkTogetToenableCommunication whileensuringsecurity.1.networkportSarevirtualendpointsnumbered0–65535, Withwell-nownports like80 (http), 443 (https), 22 (ssh) ? 25 (smtp) ?? (specservices

Java 's Garbage Collection (GC)? ???? ???? ???? ??????, ?? ? ??? ??? ? ??? ??? ??? ??? ????. 1.GC? ?? ?? (? : ?? ??, ?? ???, ?? ?? ?)?? ??? ???? ????, ?? ? ??? ??? ???? ?????. 2. ?? ???? ????? ????, ?? ?? ??? ??? ???? ?? ??? ??????. 3. ?? ?? ?? ?? : ??? ?? (Eden, S0, S1)? ?? ????? ?????. ??? ??? ?? ? MajorGC? ???? ? ??? ? ????. Metaspace? ??? ?? ???? ?????. 4. JVM? ??? GC ??? ?????. SerialGC? ??? ?? ????? ?????. ParallelGC? ???? ??????. CMS? ?? ???

GradleisBetTerChoiceFormostNewProjectSduetoitssuperiorflexible, Performance, and ModernToolingsupport.1.Gradle'Sgroovy/kotlindslismoreConcisENDEXPRESSIVETHANMAVEN'SVOSEXML.2.GradleOutsMaveninbuildweedweedweedweedweedweedweedweedweedweedweedweedweedweede

DEFER? ??? ???? ?? ??? ??? ???? ? ?????. ?? ??? ?? ? ? ?? ????, ??? ??? ? ?? ?? (LIFO)? ??? ?????. 1. ?? ??? ??? ? ??? ?????. 2. ?? ??? ?? ??? ??? ????? ?????. 3. ?? ? ?? ?? ??? ? ????. 4. ??? ?????? ??? ??? ???? ?????. 5. ?? ??? ???? ?? ??? ?? ??? ?????. ??? ??? ?? ?? ? ???? ???? ? ????.

??? htmlinput ??? ???? ??? ???? ????? ??? ??? ?? ??? ???? ???? ? ????. 1. ???, ???, ??, ?? ? ??? ?? ??? ??? ?? ?? ?? ??? ???? ???? ??? ? ???? ??? ? ????. 2. HTML5? ?????? ??? ? ?? ?? ??? ?? ? ??? URL, ??, ?? ? ??? ?? ??? ??? ??????. 3. ?? ?? ? ? ??? ??? ???? ?? ??? ???? ???? ?? ???? ?? ???? ???? ?? ? ? ??? ?? ???????.
