DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
View Events Video Library
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Integrating PostgreSQL Databases with ANF: Join this workshop to learn how to create a PostgreSQL server using Instaclustr’s managed service

Mobile Database Essentials: Assess data needs, storage requirements, and more when leveraging databases for cloud and edge applications.

Monitoring and Observability for LLMs: Datadog and Google Cloud discuss how to achieve optimal AI model performance.

Automated Testing: The latest on architecture, TDD, and the benefits of AI and low-code tools.

Related

  • Universal Implementation of BFS, DFS, Dijkstra, and A-Star Algorithms
  • Queue in Data Structures and Algorithms
  • Unlocking the Power of AIOps: Enhancing DevOps With Intelligent Automation for Optimized IT Operations
  • Understanding AVL Trees in C#: A Guide to Self-Balancing Binary Search Trees

Trending

  • Automated Testing: The Missing Piece of Your CI/CD Puzzle
  • Java Parallel GC Tuning
  • AWS vs. Azure vs. Google Cloud: Comparing the Top Cloud Providers
  • Reflections From a DBA
  1. DZone
  2. Data Engineering
  3. AI/ML
  4. Optimized but Way Out of Line

Optimized but Way Out of Line

Oren Eini user avatar by
Oren Eini
·
Aug. 05, 13 · Interview
Like (0)
Save
Tweet
Share
2.81K Views

Join the DZone community and get the full member experience.

Join For Free

yesterday i showed the following profiler results.

image

the first place someone would look at optimizing is the caseinsensitivecomparator.compare call, right? that is clearly taking a really long time.

in fact, we re-wrote that method to use pointer magic in order to get it to work faster. but that isn’t the issue. look at the numbers . compare is called 68 million times. that means that under the profiler, it is still completing an operation in 0.000073 ms. i am not even sure what time unit that is .

however, we can see that the major caller for compare was findgreaterorequal, right? and that is called only 11 thousand times. what does this tells you?

that tells me we have a schlemiel the painter's algorithm . so i double checked, and skiplist insert perf should be o(logn) on average. but what we were seeing is o(n) costs .indeed, it appeared that we had a bug in which our skip list implementation would never do skips, essentially turning it into a sorted linked list, with insert perf of o(n). once we fixed that bug… well, things got better, a lot better.

image

as you can see, the cost of this went down really hard. and now we can focus on other stuff.

optimization Pointer (computer programming) Implementation Algorithm

Published at DZone with permission of Oren Eini, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Universal Implementation of BFS, DFS, Dijkstra, and A-Star Algorithms
  • Queue in Data Structures and Algorithms
  • Unlocking the Power of AIOps: Enhancing DevOps With Intelligent Automation for Optimized IT Operations
  • Understanding AVL Trees in C#: A Guide to Self-Balancing Binary Search Trees

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends: