Skip to content

Conversation

@neel5682
Copy link

@neel5682 neel5682 commented Feb 22, 2025

fixed memory issues by optimizing project settings.
Resolved compiler warnings to improve code quality.
Enhanced error handling for better stability.
Updated dependencies and JVM options for improved performance.

@szymon-rd
Copy link
Member

There are a lot of files in this MR. Only changes to the source code should be in the diff.

build.sbt Outdated
val lwjglVersion = "3.3.3"
val jomlVersion = "1.10.0"
javaOptions += "-Xmx8G"
javaOptions += "-XX:+UseG1GC"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

G1 is the default GC so no need to enable it


val limitExpr = ConstInt32(seq.limit.getOrElse(throw new IllegalArgumentException("Reduce on infinite stream is not supported")))
// Ensure a default limit to avoid infinite stream errors
val defaultLimit = 100 // Set a safe default limit
Copy link
Member

@szymon-rd szymon-rd Feb 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it is a good idea. It's pretty similar to letting people write fors in a language without upper bound, and having default = 100, it can be quite confusing. If you would like to make it more ergonomic you could make a GSeq.reduce result only be a Value after limit is called on it. That would be quite challenging but a good Scala excercise.

// Ensure a default limit to avoid infinite stream errors
val defaultLimit = 100 // Set a safe default limit
val limitExpr = ConstInt32(seq.limit.getOrElse {
println("⚠ Warning: No limit set, using default limit of " + defaultLimit)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's to be removed after addressing previous comment, but regardless, if we are to introduce warnings it's not a good idea to println. You usually want to use some logging API that can be configured/adjusted by library user, SLF4J is a good example.

case (from, _: ToUInt32[_]) if from.tag =:= Float32Tag.tag => Op.OpConvertFToU
case (from, _: ToInt32[_]) if from.tag =:= UInt32Tag.tag => Op.OpBitcast
case (from, _: ToUInt32[_]) if from.tag =:= Int32Tag.tag => Op.OpBitcast
case _ => throw new MatchError(s"Unexpected input: (${cexpr.fromTag}, $cexpr)")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@neel5682
Copy link
Author

neel5682 commented Feb 27, 2025 via email

@neel5682
Copy link
Author

neel5682 commented Feb 28, 2025 via email

@szymon-rd
Copy link
Member

Hi, honestly I feel like this MR has a bit too much AI in it - especially not in the code but in the overall direction and replies. It also added few new printlns, and that's not a good idea for core parts of a library (as I pointed out with slf4j). AI really won't work well in this library.

@neel5682
Copy link
Author

neel5682 commented Mar 4, 2025 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants