efl/src/lib/eina
Carsten Haitzler 7787b16e20 eina - threadqueue - revert series of comments that moved to mempools
Revert "eina: remove no longer used function _eina_thread_queue_msg_block_real_free"
This reverts commit 695b44526c.

Revert "eina/threadqueue: use mempool_del for hash free function"
This reverts commit b0cb3b935a.

Revert "eina_thread_queue: use normal mempools for block allocation"
This reverts commit 14ae3e3dec.

Why? Threadqueue is a highly performance sensitive API.
_eina_thread_queue_msg_block_new() may be called quite often. Doing a
hash lookup to then find a mempool handle to then allocate from was
not the same as what was there and was going to be far more costly.
This would have actual performance impact as we have to compute a hash
and rummage through a hash, hunt for an environment var too. The
original code looked at a spare block pool where blocks *MAY* be of
different sizes (not always the same size so using a mempool is
actually wrong and will stop threadqueue from being able to send
larger messages at all). If you send large messages, larger blocks would
have been allocated and put in this pool. In almost all cases the first
item in the pool would be big enough so we don't hunt and the find pulls
out the first memory, resets the fields that are needed and returns that
block. If it needs a bigger one, it does hunt. This is going to be
rare that such big blocks are needed so I never tried to optimize this
(but it could be done with an array of sizes to make a walk to find
the right sized element cheap if the need arises).

Performance dropped quite a lot. On aarch64 The above mempool usage
dropped message rate from 1037251 msg/sec to 610316. On x86 it was even
worse. It dropped from 2815775 msg/sec to 378653.

So backing this out sees the message rate is 7.4 times faster and on
aarch64 it's 1.7 times faster.

So moving to a mempool was actually just wrong (size is not always the
same). Also this ended up with a mempool of 64k for thread queue blocks even
if we only sent messages sporadically, as opposed to a single 4kb
block. So backing this out saves memory by only having 1 or 2 4k blocks
around most of the time, not a 64k mempool.

So the above patch then follow-on patches were done without accounting
for the performance implications. There were good reasons to do what I
did - because this code was highly tuned even to the point where I
used atomics instead of locks specifically to cut down some contention
overhead. Beware when you change something that there may be steep
performance implications. 7.4 times faster to go back to what was
there is a great example.
2019-12-03 11:45:42 +00:00
..
Eina.h Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_abi.c
eina_accessor.c eina: add accessors for c arrays 2019-07-03 07:41:05 +02:00
eina_accessor.h eina: add accessors for c arrays 2019-07-03 07:41:05 +02:00
eina_alloca.h eina: Add doxygen in/out tags 2018-07-18 15:21:07 +09:00
eina_array.c efl: drop deprecated Encoding key from desktop files 2017-12-13 10:27:48 -08:00
eina_array.h eina/array: added eina_array_find() api to eina_array. 2019-08-26 08:31:08 -04:00
eina_benchmark.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_benchmark.h eina: Add doxygen in/out tags 2018-07-18 15:21:07 +09:00
eina_bezier.c eina: Move include file to top 2018-05-02 19:44:25 -04:00
eina_bezier.h eina: Fix doxygen in/out tags for eina_bezier 2018-07-19 15:51:53 +09:00
eina_binbuf.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_binbuf.h eina: Improve explanation of read-only binbuf's 2018-09-19 08:41:52 +09:00
eina_binbuf_template_c.x
eina_binshare.c
eina_binshare.h eina: Add doxygen in/out tags 2018-07-18 15:21:07 +09:00
eina_clist.h eina: Add Doxygen in/out indicators to matrixsparse, clist, and array 2018-03-26 16:03:46 -07:00
eina_convert.c eina/convert: init endptr in failure case of eina_convert_strtod_c 2019-10-18 13:29:32 -04:00
eina_convert.h eina/convert: init endptr in failure case of eina_convert_strtod_c 2019-10-18 13:29:32 -04:00
eina_counter.c
eina_counter.h eina: Grammar improvements 2018-09-21 16:55:36 +09:00
eina_cow.c eina_cow: rework debug profile safety checks for recursive writes 2018-06-15 11:39:53 -04:00
eina_cow.h eina cow: Cleanup doxygen syntax 2018-09-19 08:35:02 +09:00
eina_cpu.c evas cpu - just rely on eina cpu entirely to avboid feature dups 2018-12-08 04:46:03 +00:00
eina_cpu.h replace hton and ntoh family functions with ones defined in eina 2019-02-01 14:25:35 +00:00
eina_crc.c
eina_crc.h eina: Improve API docs for eina_crc.h 2017-11-14 13:14:59 +00:00
eina_debug.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_debug.h eina: Improve doxygen formatting for eina_debug.h 2018-09-21 14:34:28 -04:00
eina_debug_bt.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_debug_bt_file.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_debug_chunk.c make mman.h private 2019-08-19 09:55:13 -04:00
eina_debug_cpu.c eina debug: fix a double unlock issue 2018-10-04 18:58:04 +09:00
eina_debug_private.h eina/debug: replace some explicit pthread_t usage with Eina_Thread 2018-06-25 15:17:14 -04:00
eina_debug_thread.c eina/debug: replace some explicit pthread_t usage with Eina_Thread 2018-06-25 15:17:14 -04:00
eina_debug_timer.c eina_debug_timer: make shutdown perform cleanups and kill the timer thread 2018-06-19 13:55:36 -04:00
eina_error.c eina_error: On Windows strerror_s() is the same than POSIX strerror_r() 2019-03-13 09:53:17 -04:00
eina_error.h docs: Fix assorted typos in legacy documentation 2019-01-28 13:14:20 +01:00
eina_evlog.c make mman.h private 2019-08-19 09:55:13 -04:00
eina_evlog.h eina: Grammar improvements 2018-09-21 16:55:36 +09:00
eina_file.c eina - add portable close all fd's we don't need function 2019-11-27 16:52:49 +00:00
eina_file.h eina - add portable close all fd's we don't need function 2019-11-27 16:52:49 +00:00
eina_file_common.c eina: fix spelling in new eina_file_statgen API 2019-09-16 12:02:42 +02:00
eina_file_common.h eina file - stat generation inexactness support 2019-07-28 11:51:15 +01:00
eina_file_win32.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_fp.c
eina_fp.h eina: Refer to sin/cos as sine/cosine instead of sinus/cosinus 2018-09-19 08:38:33 +09:00
eina_freeq.c
eina_freeq.h eina: Add doxygen in/out tags for evlog, file, fp, freeq 2018-07-24 08:30:08 -04:00
eina_hamster.c
eina_hamster.h
eina_hash.c eina/hash: optimize eina_hash_find() when hash is empty. 2019-08-09 14:00:03 +09:00
eina_hash.h eina/hash: add direct variants of list append/prepend functions 2019-07-10 14:40:42 -04:00
eina_inarray.c efl: drop deprecated Encoding key from desktop files 2017-12-13 10:27:48 -08:00
eina_inarray.h eina: Spelling fixes 2018-07-12 16:27:15 +09:00
eina_inline_array.x eina_array: do not mix declaration and definition 2019-09-23 16:43:54 +02:00
eina_inline_clist.x
eina_inline_cpu.x eina: unbreak byteswap checks 2019-10-23 15:51:08 +02:00
eina_inline_crc.x
eina_inline_f8p24.x
eina_inline_f16p16.x
eina_inline_f32p32.x
eina_inline_file.x
eina_inline_fp.x
eina_inline_hash.x eina inline hash - fix warn about switch case fallthrough 2018-11-09 11:43:59 +00:00
eina_inline_inlist.x
eina_inline_list.x
eina_inline_lock_barrier.x
eina_inline_lock_posix.x eina/lock: add errno wrapping for backtrace() calls in thread debug blocks 2018-06-25 15:20:37 -04:00
eina_inline_log.x
eina_inline_mempool.x eina: introduce an API for requesting memory near already allocated memory from an Eina_Mempool. 2019-10-30 08:14:27 -07:00
eina_inline_modinfo.x eina modinfo: improve eina modinfo guide. 2019-01-29 16:59:45 +05:30
eina_inline_private.h
eina_inline_rbtree.x eina: Add API doxygen for eina_rbtree_inline_lookup() 2017-11-13 12:04:39 +09:00
eina_inline_rectangle.x
eina_inline_safepointer.x eina safepointer - mimic 47 bit eoid patch 2017-11-24 18:29:23 +09:00
eina_inline_slice.x Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_inline_str.x Eina: add eina_strndup() API as inlined function 2019-05-01 17:57:36 -07:00
eina_inline_stringshare.x
eina_inline_tiler.x
eina_inline_trash.x
eina_inline_unicode.x
eina_inline_ustringshare.x
eina_inline_util.x
eina_inline_value.x eina: check the type before looking at anything else to avoid triggering valgrind warning. 2018-05-24 16:02:19 -07:00
eina_inline_value_util.x eina: prevent leak of Eina_Value internal allocation. 2019-09-17 10:24:08 -07:00
eina_inline_vector.x
eina_inlist.c
eina_inlist.h eina: Add doxygen in/out tags for inlist and iterator 2018-07-26 20:04:46 +09:00
eina_internal.h eina: remove eina_promise_data_get has it lead to risky use. 2019-01-16 16:10:30 -08:00
eina_iterator.c eina - iterator - remove unused variable - warn 2018-12-04 08:21:49 +00:00
eina_iterator.h docs: Fix assorted typos in legacy documentation 2019-01-28 13:14:20 +01:00
eina_lalloc.c
eina_lalloc.h eina: Add doxygen in/out tags for remaining APIs 2018-09-08 07:19:53 -04:00
eina_list.c eina: make use of the new near allocation policy for Eina_List. 2019-10-30 08:14:28 -07:00
eina_list.h eina list - make eina list magic optional and for now turn it off 2019-08-21 20:02:24 +01:00
eina_lock.c eina_debug: add function to reset debug subsystem after fork 2018-06-19 13:55:36 -04:00
eina_lock.h eina_lock: add empty do-while in macro 2018-10-22 11:34:45 +02:00
eina_log.c eina_log: ensure that we do not spam journald with our intree binaries 2019-09-23 15:52:27 +02:00
eina_log.h eina: Add doxygen in/out tags for log 2018-07-27 20:20:44 -04:00
eina_magic.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_magic.h eina: Fix spelling errors in documentation (log..matrix) 2017-11-01 11:36:50 +09:00
eina_main.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_main.h eina: Grammar improvements 2018-09-21 16:55:36 +09:00
eina_matrix.c eina_matrix: replace cosf by cos to gain more accuracy 2019-11-21 17:50:33 +09:00
eina_matrix.h eina: Add doxygen in/out tags for remaining APIs 2018-09-08 07:19:53 -04:00
eina_matrixsparse.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_matrixsparse.h eina: Cleanup documentation for Sparse Matrix. 2018-04-16 11:20:24 -07:00
eina_mempool.c eina: introduce an API for requesting memory near already allocated memory from an Eina_Mempool. 2019-10-30 08:14:27 -07:00
eina_mempool.h eina: introduce an API for requesting memory near already allocated memory from an Eina_Mempool. 2019-10-30 08:14:27 -07:00
eina_mmap.c reduce syscalls on opening files - roll CLOEXEC into open 2019-07-26 11:43:17 +01:00
eina_mmap.h eina: Add doxygen in/out tags for mmap and module 2018-07-28 11:50:49 -04:00
eina_module.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_module.h eina: Add doxygen in/out tags for mmap and module 2018-07-28 11:50:49 -04:00
eina_prefix.c eina/prefix: ignore magic files when running in tree 2019-05-29 12:29:03 -04:00
eina_prefix.h eina: Spelling fixes 2018-07-12 16:27:15 +09:00
eina_private.h Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_promise.c eina: always initialize all the field of Eina_Value used by Eina_Promise. 2019-05-09 09:33:27 -07:00
eina_promise.h docs: Fix common misspellings in H files 2019-04-02 13:28:48 +02:00
eina_promise_private.h eo: make efl_future_then have a data pointer in addition of the object pointer. 2018-12-07 12:23:11 +01:00
eina_quad.c
eina_quad.h eina: Add doxygen in/out tags 2018-07-18 15:21:07 +09:00
eina_quadtree.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_quadtree.h eina: document quadtree 2018-01-12 11:25:04 -08:00
eina_quaternion.c
eina_quaternion.h eina: Add doxygen in/out tags for quaternion 2018-07-31 15:16:53 -04:00
eina_rbtree.c
eina_rbtree.h eina: Add doxygen in/out tags for rbtree 2018-07-31 15:27:09 -04:00
eina_rectangle.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_rectangle.h eina: add comparison macros for Eina_Size2D and Eina_Position2D 2019-10-29 14:52:58 -04:00
eina_refcount.h
eina_safepointer.c make mman.h private 2019-08-19 09:55:13 -04:00
eina_safepointer.h eina: Add doxygen in/out tags for safepointer, safety_checks, slice, etc. 2018-08-15 09:54:17 +01:00
eina_safety_checks.c
eina_safety_checks.h eina: Add doxygen in/out tags for safepointer, safety_checks, slice, etc. 2018-08-15 09:54:17 +01:00
eina_sched.c
eina_sched.h
eina_share_common.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_share_common.h
eina_simple_xml_parser.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_simple_xml_parser.h eina: Add doxygen in/out tags for safepointer, safety_checks, slice, etc. 2018-08-15 09:54:17 +01:00
eina_slice.h replace strndup with eina_strndup, remove strndup definition in evil and elm_test_dnd 2019-05-03 13:13:57 +01:00
eina_slstr.c eina: add eina_slstr_copy_new_length. 2019-05-29 13:49:26 -04:00
eina_slstr.h eina: add eina_slstr_copy_new_length. 2019-05-29 13:49:26 -04:00
eina_str.c
eina_str.h replace strndup with eina_strndup, remove strndup definition in evil and elm_test_dnd 2019-05-03 13:13:57 +01:00
eina_strbuf.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_strbuf.h eina: Add doxygen in/out tags for strbuf's and ustrbuf's parameters 2018-07-13 18:23:27 +09:00
eina_strbuf_common.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_strbuf_common.h Eina binbuf: add explicit null-check before magic-check 2018-07-16 06:09:38 -04:00
eina_strbuf_template_c.x
eina_stringshare.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_stringshare.h eina: Add doxygen in/out tags for remaining APIs 2018-09-08 07:19:53 -04:00
eina_thread.c eina: mark thread by default as not cancellable as per Eina documentation. 2018-04-05 10:39:30 -07:00
eina_thread.h eina: Add doxygen in/out tags for remaining APIs 2018-09-08 07:19:53 -04:00
eina_thread_queue.c eina - threadqueue - revert series of comments that moved to mempools 2019-12-03 11:45:42 +00:00
eina_thread_queue.h eina: Add doxygen in/out tags for remaining APIs 2018-09-08 07:19:53 -04:00
eina_tiler.c eina - tiler -= return true if rect alreadt there as its not a failure 2018-02-11 15:55:13 +09:00
eina_tiler.h eina: Add doxygen in/out tags for remaining APIs 2018-09-08 07:19:53 -04:00
eina_tmpstr.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_tmpstr.h eina: Add doxygen in/out tags for remaining APIs 2018-09-08 07:19:53 -04:00
eina_trash.h eina: Add doxygen in/out tags for remaining APIs 2018-09-08 07:19:53 -04:00
eina_types.h eina: move definition of EFL64 2018-10-02 16:13:13 +02:00
eina_unicode.c eina_unicode: return NULL if allocation fails 2019-04-30 09:24:48 +01:00
eina_unicode.h eina: Add doxygen in/out tags for remaining APIs 2018-09-08 07:19:53 -04:00
eina_ustrbuf.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_ustrbuf.h eina: Add doxygen in/out tags for strbuf's and ustrbuf's parameters 2018-07-13 18:23:27 +09:00
eina_ustringshare.c
eina_ustringshare.h eina: Add doxygen in/out tags for remaining APIs 2018-09-08 07:19:53 -04:00
eina_util.c macOS: make eina_environment_tmp_get() work as elsewhere. 2018-10-02 16:14:47 +02:00
eina_util.h eina: safe guard against macro expension error in EINA_*_EQ 2019-02-28 10:22:16 +01:00
eina_value.c eina: only the type need to be NULL to assume EINA_VALUE_EMPTY. 2019-10-31 14:52:41 +01:00
eina_value.h Fix cut&paste error in docs 2019-01-17 11:49:01 +01:00
eina_value_util.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_value_util.h eina: Add doxygen in/out tags for value and value_util 2018-07-31 16:40:43 -04:00
eina_vector.h efl_canvas_animation_rotate: adjust API 2019-11-04 13:06:53 +01:00
eina_vpath.c eina_vpath: add null checking logic on vpath_resolve api 2019-08-27 20:25:02 +09:00
eina_vpath.h Eina vpath: remove support of ~username vpath on Windows 2019-07-18 09:36:25 +02:00
eina_vpath_xdg.c Evil: remove pwd code in Evil and fix compilation failures after the removal 2019-07-28 09:27:27 +01:00
eina_xattr.c Eina: replace Evil.h with evil_private.h and remove Evil.h when not necessary 2019-05-16 13:48:59 -04:00
eina_xattr.h eina: Add doxygen in/out tags for remaining APIs 2018-09-08 07:19:53 -04:00
meson.build Eina: define EINA_HAVE_DEBUG_THREADS only if backtrace() in execinfo.h is available 2019-07-28 09:21:53 +01:00