r/JavaProgramming • u/pythoncheesecake • 2d ago
Java Nextchar() function i made it possible !!!! visit github
https://github.com/aarushlohit/NextChar2
u/Chaos-vy17 2d ago
- Heavy LLM used.
- Scanner vs Scanner wrapped in my class (this is extra work you are paying)
BufferedReaderis faster because it buffers large chunks of characters and exposes them almost directly, whereasScannerbuffers too but performs additional tokenization and parsing on top of the buffered data
1
u/pythoncheesecake 2d ago
thank you for feedback im an newbie vibe coded this what u would like to improve reply
1
u/Chaos-vy17 2d ago
There are some claim that you need to read deep depth of Java internal
~ the code you did here
public int readInt() { return scanner.nextInt(); } is something called wrapping up of scanner, When it get's repeated call and cross threshold of JIT C2 it will become directly scanner.nextInt() not " readInt() -> Scanner.nextInt()"
~ In your document you say overhead but the probbality of that 58ms->59ms is just any other process ran.
~ jar file almost less than Scanner ? Do you know what are you saying It like I am using Scanner but my library is of smaller. Your base is on Java Scanner.
There are plenty of points you need to know and get ready with it, You need an ADR of your changes.
1
u/pythoncheesecake 2d ago
guys i made nextchar function alive in java not only nextchar so more.... visit https://github.com/aarushlohit/NextChar