Skip to content

Conversation

@jairad26
Copy link
Contributor

@jairad26 jairad26 commented May 31, 2025

Description of changes

Updated perf benchmarks for single node chroma on docs, also adds theme-image, which can be reused in the future to have different images for light vs dark theme

Test plan

How are these changes tested?

  • Tests pass locally with pytest for python, yarn test for js, cargo test for rust

Documentation Changes

Are all docstrings for user-facing APIs updated if required? Do we need to make documentation changes in the docs section?

Copy link
Contributor Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions
Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@jairad26 jairad26 marked this pull request as ready for review May 31, 2025 02:11
@propel-code-bot
Copy link
Contributor

propel-code-bot bot commented May 31, 2025

Update Single-Node Performance Benchmarks and Add Theme-Aware Images to Docs

This PR updates the single-node Chroma performance benchmark documentation with new empirical data and significantly expands the discussion of system behavior, latency, and scaling. It introduces a reusable, theme-aware MarkdocImage React component to support light and dark mode documentation imagery, adjusts Markdoc configuration to integrate this component, and replaces static inline images with the new multi-theme approach and updated graphics. The benchmarks table and descriptive sections have been refactored for improved accuracy and clarity, and corresponding image assets have been added.

Key Changes:
• Introduced MarkdocImage React component to enable light/dark theme image support in documentation.
• Extended Markdoc configuration (config.ts) to register the MarkdocImage tag and its attributes.
• Rewrote large sections of the performance.md page for clearer, empirically updated benchmarking data, adding detailed descriptions of performance limitations, latency characteristics, concurrency, and scalability implications.
• Swapped inline images for MarkdocImage tags and added new/updated image assets optimized for both light and dark themes.
• Revised data tables and narrative to reflect recent performance test results.

Affected Areas:
• Documentation - performance benchmarks and explanatory text
• Markdoc documentation configuration and components
• Image assets for documentation

Potential Impact:

Functionality: No effect on core library functionality, but documentation experience is improved, especially for users in different display modes. Benchmarks reflect more recent real-world hardware/software performance.

Performance: No runtime system impact; documentation site performance may slightly increase due to additional conditional rendering logic in MarkdocImage but not significant.

Security: No material impact on security.

Scalability: No direct application impact; documentation now provides clearer guidance on scaling limits and system behaviors under load.

Review Focus:
• Ensure all new/existing images display as expected in both light and dark mode, and fallbacks are correct.
• Look for copy-paste or content errors in the updated benchmarking tables or narrative (fact checking).
• Check that MarkdocImage is correctly integrated and not breaking any previous use-cases.
• Assess whether any remaining in-line image references should use MarkdocImage for theme support.

Testing Needed

• Manually inspect documentation pages in both light and dark themes to verify correct image rendering and overall presentation.
• Spot-check MarkdocImage usage across updated docs to ensure alt and src attributes are set and fallback logic works if theme info is missing or not loaded.
• Review new benchmark tables and accompanying narrative for consistency and accuracy.

Code Quality Assessment

docs/docs.trychroma.com/components/markdoc/markdoc-image.tsx: Good: Well-structured, leverages React state and next-themes for dynamic theme detection, uses prop typing, sets sensible defaults. No obvious performance or code-style issues.

docs/docs.trychroma.com/markdoc/content/production/administration/performance.md: Well-organized, factually dense, uses Markdoc tags for modularity. Some long sentences, but style matches technical documentation norms.

docs/docs.trychroma.com/markdoc/config.ts: Clean integration of new tag, maintains strong typing, logical grouping of component registrations.

Best Practices

Documentation:
• Provides real, current, empirically gathered data for benchmarks.
• Improves accessibility and UX with alt text and alt theme images.
• Uses modular custom components for maintainability and extensibility.

React:
• Uses functional components, hooks, prop typing, and proper resource management.

Potential Issues

• Theme detection is client-only; images may briefly flash with incorrect theme on SSR/hydration edge cases.
• Any old direct image references remaining will not benefit from theme support (may not be a problem, but worth a check).
• If MarkdocImage is misused (missing a required src or alt), renders may break or degrade accessibility.
• The documentation's technical accuracy depends on the correctness of the new benchmark data (cannot be programmatically verified).

This summary was automatically generated by @propel-code-bot

## Concurrency

Although aspects of HNSW’s algorithm are multithreaded internally, only one thread can read or write to a given index at a time. For the most part, single-node Chroma is fundamentally single threaded. If an operation is executed while another is still in progress, it blocks until the first one is complete.
The Rust rewrite fundamentally changed Chroma's concurrency model. The system now handles concurrent operations in parallel, so latency remains consistently low and flat across all batch sizes for writes, and scales linearly for queries.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This could be odd if you don't have context

| **t3.xlarge** | 16 | 3,600,000 | 30ms | 100ms | 13ms | 30ms | $121.888 |
| **t3.2xlarge** | 32 | 7,500,000 | 30ms | 100ms | 13ms | 30ms | $242.976 |
| **r7i.2xlarge** | 64 | 15,000,000 | 13ms | 50ms | 7ms | 13ms | $386.944 |
| **t3.small** | 2 | 250,000 | 231ms | 2335ms | 8ms | 29ms | $15.936 |
Copy link
Collaborator

Choose a reason for hiding this comment

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

Were these in the same region?feels a bit high

Copy link
Contributor Author

@jairad26 jairad26 Jun 2, 2025

Choose a reason for hiding this comment

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

yeah these are in the same region. i think the reason p999 for t3.small is this high is bc this was measured it's near max collection size (these p999's are for collection size of 200k). got that number based on the last run of tests. I'll drop the ones way out of st dev, because theyre not representative, and have what we can consider outside factors (OOM)

@HammadB
Copy link
Collaborator

HammadB commented May 31, 2025

Btw I think these will look odd in light mode, they are optimized for dark mode

@jairad26
Copy link
Contributor Author

jairad26 commented Jun 2, 2025

Btw I think these will look odd in light mode, they are optimized for dark mode

yes, here's an image in light mode
image

and here's another page from the docs
image

i think it looks comparable to the rest of the docs, so didn't look into adding alt images for light/dark mode (i couldnt find any examples of that either). can look into that if necessary?

@jairad26
Copy link
Contributor Author

image image

@HammadB
Copy link
Collaborator

HammadB commented Jun 10, 2025

Discussed a few changes offline

@jairad26 jairad26 force-pushed the jai/single-node-benchmark-updates branch from 25a6b63 to ea456ee Compare June 11, 2025 00:00
@jairad26 jairad26 merged commit dc393a1 into main Jun 11, 2025
13 checks passed
Inventrohyder pushed a commit to Inventrohyder/chroma that referenced this pull request Aug 5, 2025
## Description of changes

Updated perf benchmarks for single node chroma on docs, also adds
theme-image, which can be reused in the future to have different images
for light vs dark theme

## Test plan

_How are these changes tested?_

- [ ] Tests pass locally with `pytest` for python, `yarn test` for js,
`cargo test` for rust

## Documentation Changes

_Are all docstrings for user-facing APIs updated if required? Do we need
to make documentation changes in the [docs
section](https://github.com/chroma-core/chroma/tree/main/docs/docs.trychroma.com)?_
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.

3 participants