-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Reduce use of Vector::resize() #47698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce use of Vector::resize() #47698
Conversation
EWS run on current version of this PR (hash 7f562d7) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
r+ WebGPU changes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have a more optimized function for growing a known-to-be-freshly-created vector? It would be analogous to reserveInitialCapacity
. Seems a common idiom but maybe not worth creating yet another function.
I will look into it in a follow up. I guess I'll do some A/B testing to see if we see any impact when adopting globally. |
https://bugs.webkit.org/show_bug.cgi?id=295565 Reviewed by Darin Adler. Reduce use of Vector::resize(), in favor of more efficient alternatives. * Source/JavaScriptCore/b3/air/AirAllocateRegistersByGreedy.cpp: (JSC::B3::Air::Greedy::GreedyAllocator::forEachTmpInGroup): * Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp: * Source/JavaScriptCore/dfg/DFGValidate.cpp: * Source/JavaScriptCore/jit/ExecutableAllocator.cpp: * Source/JavaScriptCore/wasm/WasmSectionParser.cpp: (JSC::Wasm::SectionParser::parseFunctionType): (JSC::Wasm::SectionParser::parseStructType): * Source/JavaScriptCore/yarr/YarrJIT.cpp: * Source/WTF/wtf/Assertions.cpp: * Source/WTF/wtf/Dominators.h: (WTF::Dominators::NaiveDominators::NaiveDominators): * Source/WebCore/Modules/mediastream/STUNMessageParsing.cpp: (WebCore::WebRTC::extractSTUNOrTURNMessages): * Source/WebCore/contentextensions/DFAMinimizer.cpp: * Source/WebCore/crypto/cocoa/CryptoAlgorithmRSA_OAEPMac.cpp: (WebCore::decryptRSA_OAEP): * Source/WebCore/html/canvas/WebGL2RenderingContext.cpp: (WebCore::WebGL2RenderingContext::initializeContextState): * Source/WebCore/platform/audio/AudioResampler.cpp: (WebCore::AudioResampler::configureChannels): * Source/WebCore/platform/gamepad/mac/MultiGamepadProvider.mm: (WebCore::MultiGamepadProvider::indexForNewlyConnectedDevice): * Source/WebCore/platform/graphics/avfoundation/objc/CDMInstanceFairPlayStreamingAVFObjC.mm: (WebCore::CDMInstanceSessionFairPlayStreamingAVFObjC::optionsForKeyRequestWithHashSalt): * Source/WebCore/platform/mediastream/mac/MockAudioSharedUnit.mm: (WebCore::MockAudioSharedInternalUnit::reconfigure): * Source/WebCore/rendering/GridMasonryLayout.cpp: (WebCore::GridMasonryLayout::resizeAndResetRunningPositions): * Source/WebCore/rendering/RenderFrameSet.cpp: (WebCore::RenderFrameSet::GridAxis::resize): * Source/WebCore/rendering/svg/SVGTextLayoutAttributes.cpp: (WebCore::SVGTextLayoutAttributes::clear): * Source/WebCore/rendering/svg/SVGTextMetricsBuilder.cpp: (WebCore::SVGTextMetricsBuilder::measureTextRenderer): * Source/WebCore/testing/MockGamepadProvider.cpp: (WebCore::MockGamepadProvider::setMockGamepadDetails): * Source/WebGPU/WebGPU/ComputePassEncoder.mm: (WebGPU::ComputePassEncoder::setPipeline): * Source/WebGPU/WebGPU/HardwareCapabilities.mm: (WebGPU::mergeFeatures): * Source/WebGPU/WebGPU/RenderPassEncoder.mm: (WebGPU::RenderPassEncoder::setPipeline): Canonical link: https://commits.webkit.org/297166@main
7f562d7
to
d5c8c97
Compare
Committed 297166@main (d5c8c97): https://commits.webkit.org/297166@main Reviewed commits have been landed. Closing PR #47698 and removing active labels. |
d5c8c97
7f562d7