Skip to content

perf: Replace LinkedList with ArrayList for O(1) access performance#9

Open
maheshkumargangula wants to merge 52 commits intodevelopfrom
fix/performance-optimizations
Open

perf: Replace LinkedList with ArrayList for O(1) access performance#9
maheshkumargangula wants to merge 52 commits intodevelopfrom
fix/performance-optimizations

Conversation

@maheshkumargangula
Copy link

PR Title

perf: Replace LinkedList with ArrayList for O(1) access performance

Base Branch

develop

Summary

  • Replaced LinkedList with ArrayList in two service classes that use lists for iteration and random-access patterns — ArrayList provides O(1) random access vs O(n) for LinkedList, and has better CPU cache locality for sequential iteration
  • LinkedList is only preferable for frequent head/tail insertions with addFirst/removeFirst — neither of these usages qualifies

Files Changed

  • modules/userorg/service/.../BaseBulkUploadBackgroundJobActor.java
  • modules/userorg/service/.../UserRoleServiceImpl.java

Implements Tasks

PF-07

Test Plan

  • Run existing unit tests: mvn test -pl modules/userorg/service
  • No behavior changes — purely internal data structure swap

Claude Coordinator and others added 30 commits February 21, 2026 17:10
…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.
… base images, adding `commons-io` dependency
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