Closed
Bug 1525953
Opened 6 years ago
Closed 3 years ago
make log module creation better
Categories
(Core :: XPCOM, enhancement)
Core
XPCOM
Tracking
()
RESOLVED
FIXED
People
(Reporter: froydnj, Unassigned)
References
Details
Attachments
(5 files)
1.96 KB,
patch
|
Details | Diff | Splinter Review | |
2.49 KB,
patch
|
Details | Diff | Splinter Review | |
1.70 KB,
patch
|
Details | Diff | Splinter Review | |
2.49 KB,
patch
|
Details | Diff | Splinter Review | |
1.26 KB,
patch
|
Details | Diff | Splinter Review |
This doesn't improve actually fetching already-created log modules, but it will
make their point of creation slightly faster and eliminates a little bit of
process memory to boot.
![]() |
Reporter | |
Comment 1•6 years ago
|
||
They are already, and ensuring this means that we can remove some
allocations in later patches.
Attachment #9042171 -
Flags: review?(erahm)
![]() |
Reporter | |
Comment 2•6 years ago
|
||
Now that log module names are guaranteed to be in static storage, we can
depend on them directly, rather than allocating storage for them in the
hash table.
Attachment #9042172 -
Flags: review?(erahm)
![]() |
Reporter | |
Comment 3•6 years ago
|
||
The module name comes via LazyLogModule, which is guaranteed to have
statically-allocated names, so there's no reason we have to strdup here.
Attachment #9042173 -
Flags: review?(erahm)
![]() |
Reporter | |
Comment 4•6 years ago
|
||
This is partially a workaround for C++'s visibility rules, but it might
also make a difference if constructor arguments are particularly
expensive to construct. Having a lambda means that the evaluation of
those arguments can be delayed until necessary, unlike LookupOrAdd.
Attachment #9042174 -
Flags: review?(erahm)
![]() |
Reporter | |
Comment 5•6 years ago
|
||
No reason to do the hash lookup twice here.
Attachment #9042175 -
Flags: review?(erahm)
![]() |
Reporter | |
Comment 6•6 years ago
|
||
Comment on attachment 9042172 [details] [diff] [review]
part 2 - don't duplicate strings in LogModuleManager's hash table
Ugh, we can't do this because you can pass in dynamic module names via preferences and such.
Attachment #9042172 -
Flags: review?(erahm)
![]() |
Reporter | |
Comment 7•6 years ago
|
||
Comment on attachment 9042173 [details] [diff] [review]
part 3 - don't duplicate strings in LogModule
Same problem as with part 2, though maybe you could get this to be tied to the lifetime of the hash key, and reuse the same thing for both?
Comment 8•6 years ago
|
||
Comment on attachment 9042171 [details] [diff] [review]
part 1 - enforce that LazyLogModule names are compile-time constants
Clearing reviews for now, I don't think this is ready yet. Let me know if you want me to review other parts.
Attachment #9042171 -
Flags: review?(erahm)
Updated•6 years ago
|
Attachment #9042173 -
Flags: review?(erahm)
Updated•6 years ago
|
Attachment #9042174 -
Flags: review?(erahm)
Updated•6 years ago
|
Attachment #9042175 -
Flags: review?(erahm)
Comment 9•3 years ago
|
||
The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.
Assignee: froydnj+bz → nobody
Comment 10•3 years ago
|
||
The main change in this bug happened as one of the bulk changes in bug 1691894, so we can resolve this.
You need to log in
before you can comment on or make changes to this bug.
Description
•