perf: Replace LinkedList with ArrayList for O(1) access performance#9
Open
maheshkumargangula wants to merge 52 commits intodevelopfrom
Open
perf: Replace LinkedList with ArrayList for O(1) access performance#9maheshkumargangula wants to merge 52 commits intodevelopfrom
maheshkumargangula wants to merge 52 commits intodevelopfrom
Conversation
…PF-07) - Replace LinkedList with ArrayList in BaseBulkUploadBackgroundJobActor - Replace LinkedList with ArrayList in UserRoleServiceImpl - ArrayList provides O(1) random access vs O(n) for LinkedList in iteration-heavy code Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Rename UserOrg artifacts to `userorg-service-impl` and `userorg-controller` for clarity. - Update `activity-aggregator` to use `sunbird-actor-utils` and `sunbird-redis-utils`. - Align all `notification` and `lms` module dependencies with new core artifact names. - Ensure consistent `1.0-SNAPSHOT` versioning across all service modules.
- Add dependencyManagement section to root pom.xml for standardized versions of Jackson, Pekko, Netty, Guava, and Guice. - Create comprehensive README.md detailing project structure, build instructions for merged and individual services, and prerequisites.
- Add initial Play framework application structure with controllers, actors, and modules. - Implement core service components including HealthActor, SyncController, and RequestInterceptor. - Configure application routing, logging, and dependency injection modules. - Setup pom.xml with dependencies for aggregating LMS, UserOrg, and Notification services.
- Add updateRecordWithPutAll and batchUpdateWithPutAll methods to CassandraOperation interface. - Implement putAll logic in CassandraOperationImpl using Datastax QueryBuilder.putAll for merging map columns. - Add createUpdateQueryWithPutAll helper in CassandraUtil to construct the necessary statements.
…ator - activity-aggregator: migrate to batchUpdateWithPutAll for merging course progress maps in Cassandra. - tests: update ActivityAggregatorActorTest to include mocks for the new batchUpdateWithPutAll operation.
- workflows: add pr-checks.yml to build core first, then services in parallel, followed by aggregated SonarQube analysis. - lern-report: add module to aggregate JaCoCo coverage reports from all services. - lms-report: add aggregation module for LMS service coverage. - pom.xml: register report modules in the build reactor.
…ndling - Resolved Pekko dispatcher errors in notification actor system. - Improved OnRequestHandler and BaseController for reliable request context. - Implemented graceful shutdown and strengthened test mocking.
- Upgrade jackson.version to 2.17.0 and netty.version to 4.1.118.Final - Force secure versions in dependencyManagement for protobuf, okhttp, and snakeyaml - Exclude vulnerable jackson-mapper-asl and replace dom4j 1.1 with 2.1.4 - Standardize testing dependencies with mockito 3.12.4 and mockito-inline - Resolve transitive security issues in core and userorg modules
- Remediate LZ4 vulnerability by excluding insecure versions and forcing 'at.yawk.lz4:lz4-java:1.10.1' across modules. - Upgrade Apache Velocity to 2.x and Velocity Tools to 3.1. - Refactor 'ProjectUtil' and 'SMSTemplateProvider' to use Velocity 2.x compatible configuration keys and standard 'Velocity.evaluate' for template rendering. - Fix 'VelocityContext' type mismatch errors by manually populating context from 'Map<String, String>'. - Standardize 'commons-lang3' usage and clean up redundant POM properties.
- Modified 'OTPUtil' to strictly ensure 6-digit OTPs using zero-padding and updated minimum length guards while preserving retry logic. - Updated 'pr-checks.yml' workflow to include 'lern-build' job, ensuring binary files are available for SonarQube analysis. - Standardized JaCoCo aggregated report path in 'lern-report/pom.xml' to fix cross-module coverage reporting. - Resolved SonarQube 'missing compiled classes' error by removing compilation skips in the analysis step.
…rename report modules
… base images, adding `commons-io` dependency
…dled commons-io 2.8.0 (CVE-2024-47554)
… add required testing dependencies.
…agementActorTest.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Title
perf: Replace LinkedList with ArrayList for O(1) access performance
Base Branch
develop
Summary
LinkedListwithArrayListin two service classes that use lists for iteration and random-access patterns —ArrayListprovides O(1) random access vs O(n) forLinkedList, and has better CPU cache locality for sequential iterationLinkedListis only preferable for frequent head/tail insertions withaddFirst/removeFirst— neither of these usages qualifiesFiles Changed
modules/userorg/service/.../BaseBulkUploadBackgroundJobActor.javamodules/userorg/service/.../UserRoleServiceImpl.javaImplements Tasks
PF-07
Test Plan
mvn test -pl modules/userorg/service