You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fury.apache.org by "mof-dev-3 (via GitHub)" <gi...@apache.org> on 2024/01/01 02:34:50 UTC
[PR] [Java] refine Collection util data structure (#1287) [incubator-fury]
mof-dev-3 opened a new pull request, #1288:
URL: https://github.com/apache/incubator-fury/pull/1288
1. use local reference when possible
2. make tuple value field final
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [PR] [Java] refine Collection util data structure (#1287) [incubator-fury]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang merged PR #1288:
URL: https://github.com/apache/incubator-fury/pull/1288
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [PR] [Java] refine Collection util data structure (#1287) [incubator-fury]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1288:
URL: https://github.com/apache/incubator-fury/pull/1288#discussion_r1438956263
##########
java/fury-core/src/main/java/org/apache/fury/collection/FuryObjectMap.java:
##########
@@ -180,6 +180,7 @@ public V put(K key, V value) {
/** Skips checks for existing keys, doesn't increment size. */
private void putResize(K key, V value) {
K[] keyTable = this.keyTable;
+ V[] valueTable = this.valueTable;
Review Comment:
This is accessed only once, it's unnecessary to make it as a local variable
##########
java/fury-core/src/main/java/org/apache/fury/collection/Tuple3.java:
##########
@@ -50,6 +52,70 @@ public Tuple3(T0 value0, T1 value1, T2 value2) {
this.f2 = value2;
}
+ /**
+ * Creates a new tuple and assigns the given values to the tuple's fields, with field value
+ * nonFinal.
+ *
+ * @param value0 The value for field 0
+ * @param value1 The value for field 1
+ * @param value2 The value for field 2
+ */
+ public static <T0, T1, T2> NonFinal ofNonFinal(T0 value0, T1 value1, T2 value2) {
+ return new NonFinal<>(value0, value1, value2);
+ }
+
Review Comment:
Ditto
##########
java/fury-core/src/main/java/org/apache/fury/collection/Tuple2.java:
##########
@@ -46,6 +48,43 @@ public Tuple2(T0 value0, T1 value1) {
this.f1 = value1;
}
+ public static class NonFinal<T0, T1> implements Serializable {
Review Comment:
Make this as a top level class, maybe name it as MutableTuple2?
##########
java/fury-core/src/main/java/org/apache/fury/collection/ObjectIntMap.java:
##########
@@ -92,6 +92,7 @@ public void put(K key, int value) {
private void putResize(K key, int value) {
K[] keyTable = this.keyTable;
+ int[] valueTable = this.valueTable;
Review Comment:
Accessed only once, unnecessary to use a local variable
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [PR] [Java] refine Collection util data structure (#1287) [incubator-fury]
Posted by "mof-dev-3 (via GitHub)" <gi...@apache.org>.
mof-dev-3 commented on code in PR #1288:
URL: https://github.com/apache/incubator-fury/pull/1288#discussion_r1438958195
##########
java/fury-benchmark/src/main/java/org/apache/fury/benchmark/Identity2IdMap.java:
##########
@@ -26,16 +26,16 @@
public class Identity2IdMap {
private static final int RESERVE = 4;
private static final int MAX_DEPTH = 4;
- static int[] prim = {
Review Comment:
Done. revert all change in this class
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org
Re: [PR] [Java] refine Collection util data structure (#1287) [incubator-fury]
Posted by "chaokunyang (via GitHub)" <gi...@apache.org>.
chaokunyang commented on code in PR #1288:
URL: https://github.com/apache/incubator-fury/pull/1288#discussion_r1438953986
##########
java/fury-benchmark/src/main/java/org/apache/fury/benchmark/Identity2IdMap.java:
##########
@@ -26,16 +26,16 @@
public class Identity2IdMap {
private static final int RESERVE = 4;
private static final int MAX_DEPTH = 4;
- static int[] prim = {
Review Comment:
This class is copied from fst, it's unnecessary to update it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fury.apache.org
For additional commands, e-mail: commits-help@fury.apache.org