<div dir="ltr">Hello core-libs-dev team,<br><br>My name is Memory2314, and I am a new contributor currently waiting for my Oracle Contributor Agreement (OCA) to be processed.<br><br>I have been studying the `java.time.Year.isLeap()` method and would like to propose a micro-optimization:<br><br>**Current logic:**<br>```java<br>return (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);<br>```<br><br>**Proposed optimization:**<br>```java<br>return (year & 15) == 0 || ((year & 3) == 0 && year % 100 != 0);<br>```<br><br>**Key improvements:**<br>- Replaces `year % 4 == 0` with bitwise `(year & 3) == 0`<br>- Uses `(year & 15) == 0` to efficiently detect years divisible by 400<br>- Reduces modulo operations from 3 to 1 in the common case<br><br>**Verification benchmark:**<br>```java<br>public static void main(String[] args) {<br>    int[] years = new int[1_000_000_000];<br>    Random random = new Random();<br>    for (int i = 0; i < years.length; i++) {<br>        years[i] = 1970 + random.nextInt(5000 - 1970 + 1);<br>    }<br>    <br>    long start1 = System.currentTimeMillis();<br>    for (int year : years) {<br>        boolean result = isLeapOriginal(year);<br>    }<br>    System.out.println("Original: " + (System.currentTimeMillis()-start1) + "ms");<br>    <br>    long start2 = System.currentTimeMillis();<br>    for (int year : years) {<br>        boolean result = isLeapOptimized(year);<br>    }<br>    System.out.println("Optimized: " + (System.currentTimeMillis()-start2) + "ms");<br>}<br><br>public static boolean isLeapOriginal(long year) {<br>    return (year & 15) == 0 ? (year & 3) == 0 : (year & 3) == 0 && year % 100 != 0;<br>}<br><br>public static boolean isLeapOptimized(long year) {<br>    return (year & 15) == 0 || ((year & 3) == 0 && year % 100 != 0);<br>}<br>```<br><br>**Correctness verification:** I've tested this logic extensively, including edge cases like year 0, negative years (proleptic Gregorian), and all century boundaries from -10,000 to 10,000.<br><br>I am aware that I cannot submit a formal patch until my OCA is complete. However, I would be very grateful for your initial technical feedback on this approach before I proceed to create a fully tested patch with benchmarks.<br><br>Once my OCA is in place, would there be a maintainer or an experienced contributor interested in sponsoring this change if it proves worthwhile?<br><br>Thank you for your time and consideration.<br><br>Best regards,<br>Memory2314</div>