Changes between Version 1 and Version 2 of Ticket #35399, comment 4
- Timestamp:
- Apr 24, 2024, 12:13:36 PM (7 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #35399, comment 4
v1 v2 3 3 In other words `int.__hash__` is pretty fast but `Expression.__hash__` isn't and you need to perform an implicit one to gather values in `defaultdict(list)`. Since `bulk_update` support both expressions and literal assignment the benchmark must be run against both to be representative. 4 4 5 Try running them with assignments of `F("scans_in") + Value(random.randint(0, m) )` instead and you should see a slowdown.5 Try running them with assignments of `F("scans_in") + Value(random.randint(0, m), output_field=InterField())` instead and you should see a slowdown. 6 6 7 7 The need for _hashability_ also poses another problem. What should be done with values that are not hashable such as `JSONField` assignment of `dict`s?