Replies: 1 comment
-
|
@wang1212 Hello! Here is an automated response to your question: 🚀 Performance Optimization in G v6 – Next StepsThank you for the detailed summary of the performance challenges and ongoing efforts in upgrading G from v4 to v6. Here are targeted recommendations and clarifications for each optimization area, based on current best practices and official documentation: 1️⃣ Event System DesignCurrent Actions:
Recommendations:
Example: Direct Event Handlingcircle.addEventListener('mouseenter', () => {
circle.attr('fill', '#2FC25B');
});
circle.addEventListener('mouseleave', () => {
circle.attr('fill', '#1890FF');
});2️⃣ Element Picking Process & Dependency SimplificationCurrent Actions:
Recommendations:
Example: Query Elements by Attributeconst moons = solarSystem.querySelectorAll('[r=25]'); // Finds all elements with r=253️⃣ Hook Design for Plugin ClarityCurrent Actions:
Recommendations:
Example: Rendering Service HookrenderingService.hooks.init.tap('PluginTag', () => {
// Initialization code
});4️⃣ Benchmarks & Runtime StatisticsCurrent Actions:
Recommendations:
Example: Stats Integrationcanvas.addEventListener(CanvasEvent.AFTER_RENDER, () => {
stats.update();
});📊 Reference BenchmarksTo track progress, continue updating and comparing with the official benchmarks. ✅ Summary Action Items
If you need further guidance or real code samples for any item, please specify your scenario. Let's keep momentum on these improvements! This is an automated response generated by AI. If you have any questions, our team will follow up as soon as possible. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In the process of upgrading G from v4 to v6, the underlying layer of G has been refactored a lot, from a single engine that only provides basic rendering capabilities to a plug-in engine, enriching a lot of ecological capabilities.
Unfortunately, performance issues were not paid close attention to during this process, resulting in a serious regression of performance benchmarks. So far, we have made a lot of efforts to optimize performance, but the results are still not ideal. The root cause is that our current strategy is relatively conservative. If we want to really improve performance, we need to make some adjustments to the current architecture. Considering the developer experience and maintenance costs, this is based on the premise that there are no major changes to the API.
Related performance issues:
Here are some to-do items:
rbushdependency perf: remove rBush logic from element picking mechanism #2031Completed optimization (PRs):
Reference performance benchmarks:
Beta Was this translation helpful? Give feedback.
All reactions