Closed Bug 286643 Opened 15 years ago Closed 15 years ago

Eliminate unnecessary memory zeroing for performance

Categories

(NSS :: Libraries, defect, P1)

3.10
defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: julien.pierre, Assigned: nelson)

Details

Attachments

(1 file)

In environments in which performance is all that matters, PORT_ZFree could
dispense with the memset call. Due to the frequency of allocations and
deallocations in NSS and its softoken, this is a performance win in SSL benchmarks.
We should make that runtime-configurable, once util is in a shared library.
Depends on: 286642
Assignee: wtchang → saul.edwards.bugs
QA Contact: bishakhabanerjee → jason.m.reid
We cannot check this into NSS 3.11. 
We have it checked in on the Performance hacks branch, and it is one of
the things that needs to be resolved now, as part of migrating the code
from the branch to the trunk.

There are places that really need to zero a buffer and free it.
The right way for them to do that, IMO, is to call PORT_ZFree.
PORT_ZFree should zero the memory and then free it.

Therefore, rather than disabling PORT_ZFree's ability to zero memory,
we should find the places that unnecessarily zero memory, that is,
the places that should call PORT_Free rather than PORT_ZFree, and 
change them to call PORT_Free instead.  

Doing that in Freebl should be a top priority for 3.11 (one of several :)

Priority: -- → P1
Summary: PORT_ZFree should not memset for performance uber alles → Eliminate unnecessary memory zeroing for performance
Target Milestone: --- → 3.11
Version: 3.9.5 → 3.10
No longer depends on: 286642
Removing the memset from PORT_ZFree altogether currently gives us 3.5% on
specweb.  Therefore, we need to assess which parts of the SSL socket structures
need to be zeroed (because they contain key material or messages in plaintext
form) and which we can skip.  Nelson, please attach your analysis.
Assignee: saul.edwards.bugs → nelson
Per our meeting today, this was fixed.

Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.